Parsing of declarations in all branches of preprocessor conditionals
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.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 22 · Forward citations: 8.
Claims (1 — 1 Independent, 0 Dependent)
- Claim 1Independent Claim
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: obtains 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
Technical Overview & Description
Full multi-page specification text is archived at the issuing office. Read complete official specification ↗
Cited By — Indexed Forward Citations (8 of 8 total)
References Cited — Backward Prior Art (22)
Non-Patent Literature (5)
- "ctags(1)-Linux Man Page", http://linux.die.net/man/1/ctags, dated Apr. 24, 2008.
- Garrido, et al., "Analyzing Multiple Configurations of a C Program", Proceedings of the 21st IEEE International Conference on Software Maintenance, Date: 2005, pp. 379-388, Publisher: IEEE Computer Society Washington, DC, USA.
- Garrido, et al., "Challenges of Refactoring C Programs", Proceedings of the International Workshop on Principles of Software Evolution, Date: 2002, pp. 6-14, Publisher: ACM New York, NY, USA.
- Title: Context-Free-Grammar based Token Tagger in Reconfigurable Devices,author: Young H. Cho et al, source: IEEE, dated: Apr. 24, 2006.
- Title: Syntax-directed construction of Value Dependence Graphs author: Byers, D. et al., source: IEEE, dated Nov. 9, 2001.