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 declaration serializer that 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 a 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.
2 Assignments
0 Petitions
Accused Products
Abstract
Declarations from an input source code or tokenized 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
20 Claims
-
1. A system that parses a plurality of preprocessor conditional branches of a preprocessor conditional directive statement comprising:
-
a declaration serializer that 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 a 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. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method of parsing a plurality of preprocessor conditional branches of a preprocessor conditional directive statement comprising:
-
obtaining tokenized input; in response to determining that the tokenized input represents a declaration, wherein the declaration is interrupted by a preprocessor conditional directive of a preprocessor conditional directive statement, wherein the preprocessor conditional directive statement comprises a plurality of mutually exclusive branches comprising at least a first branch and a second branch; labeling each token of the interrupted declaration with at least a first parsing path indicator of a plurality of parsing path indicators, the at least first parsing path indicator corresponding to a first parsing path, and wherein a second parsing path indicator corresponds to a second parsing path, wherein each of the plurality of parsing paths is induced by the plurality of mutually exclusive branches of the preprocessor conditional directive statement; and returning the tokens labeled with the at least first parsing path indicator in a first pass to a caller. - View Dependent Claims (9, 10, 11)
-
-
12. A computer-readable storage medium comprising computer-executable instructions which when executed cause a computing environment to:
-
obtain tokenized input representing a declaration; in response to determining that the tokenized input represents a declaration, wherein the declaration is interrupted by a preprocessor conditional directive of a preprocessor conditional directive statement, wherein the preprocessor conditional directive statement comprises a plurality of mutually exclusive branches comprising at least a first branch and a second branch, label each token of the interrupted declaration with at least a first parsing path indicator of a plurality of parsing path indicators, the at least first parsing path indicator corresponding to a first parsing path, and wherein a second parsing path indicator corresponds to a second parsing path, wherein each of the plurality of parsing paths is induced by the plurality of mutually exclusive branches of the preprocessor conditional directive statement; store the labeled tokens in a token buffer; and return the tokens labeled with the at least first parsing path indicator to a caller in a first pass of the token buffer and return the tokens labeled with the second parsing path indicator to the caller in a second pass of the token buffer. - View Dependent Claims (13, 14, 15, 16, 17, 18, 19, 20)
-
Specification