Parsing of declarations in all branches of preprocessor conditionals
First Claim
1. A system that parses a plurality of preprocessor conditional branches of a preprocessor conditional directive statement comprising:
- a computer comprising a processor and a memory, the computer further comprising;
a declaration serializer that, in order to have information available in each parsing path induced by mutually exclusive branches returned to a caller, serializes input into a stream of tokens produced by following each parsing path induced by mutually exclusive branches of a preprocessor conditional directive statement interrupting a declaration,wherein the declaration serializer labels tokens belonging to a first parsing path with a first parsing path indicator,wherein the declaration serializer labels tokens belonging to a second parsing path with a second parsing path indicator,wherein the declaration serializer fetches the tokens that belong to the first parsing path in a first pass and returns the tokens that belong to the first parsing path to the caller andwherein the declaration serializer fetches the tokens that belong to the second parsing path in a second pass and returns the tokens that belong to the second parsing path to the caller, wherein parsing paths induced by mutually exclusive branches of the preprocessor conditional directive statement are detected by matching preprocessor conditional directives of the preprocessor conditional directive statement.
1 Assignment
0 Petitions
Accused Products
Abstract
Declarations from an input source code are serialized into a stream of tokens produced by following each branch of a preprocessor conditional directive statement that interrupts a declaration. Tokens are labeled with a parsing path indicator corresponding to a parsing path induced by branches of a preprocessor conditional directive. The declarations that are formed along the different parsing paths are serialized by fetching the tokens that belong to the first parsing path in a first pass, and passing the tokens on to a next phase of a compiler. The pointer that marks the next token is repositioned to return to the start of the declaration. The declaration may be serialized again through the second parsing path in a second pass. The operation may be repeated until each of the parsing paths induced by the presence of branches of the preprocessor conditional directives in the source code is exhausted.
-
Citations
17 Claims
-
1. A system that parses a plurality of preprocessor conditional branches of a preprocessor conditional directive statement comprising:
-
a computer comprising a processor and a memory, the computer further comprising; a declaration serializer that, in order to have information available in each parsing path induced by mutually exclusive branches returned to a caller, serializes input into a stream of tokens produced by following each parsing path induced by mutually exclusive branches of a preprocessor conditional directive statement interrupting a declaration, wherein the declaration serializer labels tokens belonging to a first parsing path with a first parsing path indicator, wherein the declaration serializer labels tokens belonging to a second parsing path with a second parsing path indicator, wherein the declaration serializer fetches the tokens that belong to the first parsing path in a first pass and returns the tokens that belong to the first parsing path to the caller and wherein the declaration serializer fetches the tokens that belong to the second parsing path in a second pass and returns the tokens that belong to the second parsing path to the caller, wherein parsing paths induced by mutually exclusive branches of the preprocessor conditional directive statement are detected by matching preprocessor conditional directives of the preprocessor conditional directive statement. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A method of parsing a plurality of preprocessor conditional branches of a preprocessor conditional directive statement comprising:
-
using a processing unit, receiving an input from a caller, the input comprising the preprocessor conditional directive statement; using the processing unit, in order to have information available in each parsing path induced by mutually exclusive branches returned to the caller, serializing the input into a stream of tokens produced by following each parsing path induced by mutually exclusive branches of the preprocessor conditional directive statement interrupting a declaration by; labeling tokens belonging to a first parsing path with a first parsing path indicator; labeling tokens belonging to a second parsing path with a second parsing path indicator; fetching the tokens that belong to the first parsing path in a first pass and returning the tokens that belong to the first parsing path to the caller; and fetching the tokens that belong to the second parsing path in a second pass and returning the tokens that belong to the second parsing path to the caller, wherein parsing paths induced by mutually exclusive branches of the preprocessor conditional directive statement are detected by matching preprocessor conditional directives of the preprocessor conditional directive statement. - View Dependent Claims (8, 9, 10, 11, 12)
-
-
13. A computer-readable storage memory storing computer-executable instructions which when executed cause a computing environment to:
-
receiving an input from a caller, the input comprising the preprocessor conditional directive statement; in order to have information available in each parsing path induced by mutually exclusive branches returned to the caller, serializing the input into a stream of tokens produced by following each parsing path induced by mutually exclusive branches of the preprocessor conditional directive statement interrupting a declaration by; labeling tokens belonging to a first parsing path with a first parsing path indicator; labeling tokens belonging to a second parsing path with a second parsing path indicator; fetching the tokens that belong to the first parsing path in a first pass and returning the tokens that belong to the first parsing path to the caller; and fetching the tokens that belong to the second parsing path in a second pass and returning the tokens that belong to the second parsing path to the caller, wherein parsing paths induced by mutually exclusive branches of the preprocessor conditional directive statement are detected by matching preprocessor conditional directives of the preprocessor conditional directive statement. - View Dependent Claims (14, 15, 16, 17)
-
Specification