Method and apparatus for dynamic configuration of a lexical analysis parser
First Claim
1. A method for converting a source program into one or more tokens, comprising:
- obtaining one or more entries;
analyzing said source program; and
generating said tokens from said source program, wherein said entries may be used to generate a subset of said tokens.
2 Assignments
0 Petitions
Accused Products
Abstract
The present invention provides a method and apparatus for the lexical analysis of computer source code. The lexical analyzer is dynamically configured at runtime to recognize a one or more reserved words or operators. Thus, the analyzer has the ability to interact with multiple languages. In one or more embodiments of the present invention, the analyzer is instantiated by a host application, for example, the parser of a compiler. The host application adds a list of tokens to the analyzer that must be recognized. These tokens comprise at least a subset of the reserved words and operators of the computer language. In one embodiment, the host application then queries the analyzer for the next token in the source code. In another embodiment, tokens are added during the query phase as needed. In a separate embodiment, tokens are dynamically removed from the analyzer as the needs of the host application change.
19 Citations
27 Claims
-
1. A method for converting a source program into one or more tokens, comprising:
-
obtaining one or more entries;
analyzing said source program; and
generating said tokens from said source program, wherein said entries may be used to generate a subset of said tokens. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A computer program product comprising:
a computer usable medium having computer readable program code embodied therein configured to convert source program into one or more tokens, said computer program product comprising;
computer readable code configured to cause a computer to obtain one or more entries;
computer readable code configured to cause a computer to analyze said source program; and
computer readable code configured to cause a computer to generate said tokens from said source program, wherein said entries may be used to generate a subset of said tokens. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
19. A lexical analyzer, comprising:
-
one or more entries configured to be obtained;
a source program analyzer;
one or more tokens configured to be generated from said source program analyzer, wherein said entries may be used to generate a subset of said tokens. - View Dependent Claims (20, 21, 22, 23, 24, 25, 26, 27)
-
Specification