Embedded pre-processor with dynamic macro forms
AssigneeInternational Business Machines Corporation
InventorJoseph F. Garvey
Life of this patent
Estimating the term…
Abstract
An embedded pre-processor having dynamic macro types is disclosed. After a lexer receives an identifier token from source code, the lexer compares the identifier token with the macro names stored in the symbol table. If the identifier token matches a macro name stored in the symbol table, the lexer replaces the identifier token with a macro form token. The lexer then sends the macro form token to a glue routine. The glue routine invokes a macro invocation parser. The lexer continues to transfer tokens to the macro invocation parser via the glue routine until the completion of the macro invocation. The macro invocation parser subsequently sends a macro body definition of the macro to the lexer.
Claims10
A method for processing macros of varying grammatical invocation by a pre-processor, said method comprising:
- receiving an identifier token from source code;
- in response to said identifier token matching a macro identifier stored in a symbol table,
- replacing said identifier token with a macro form token corresponding to said identifier token from said symbol table;
- sending said macro form token to a glue routine;
- invoking a macro invocation parser by said glue routine;
- transferring tokens to said macro invocation parser via said glue routine until a completion of said macro invocation;
- and
- sending a macro body definition of said macro to a lexer by said macro invocation parser.
A computer program product residing on a computer usable medium for processing macros of varying grammatical invocation by a pre-processor, said computer program product comprising:
- program code means for receiving an identifier token from source code;
- in response to said identifier token matching a macro identifier stored in a symbol table,
- program code means for replacing said identifier token with a macro form token corresponding to said identifier token from said symbol program code means for sending said macro form token to a glue routine;
- program code means for invoking a macro invocation parser by said glue routine;
- program code means for transferring tokens to said macro invocation parser via said glue routine until a completion of said macro invocation;
- and
- program code means for sending a macro body definition of said macro to a lexer by said macro invocation parser.
Dependencies are inferred from the claim text.