Program Creates Java Lexical Analyzers
TBMG-7333
05/01/2001
- Content
Luthorj is a computer program that creates static lexical analyzers in the Java programming language, in the same sense in which Flex and Lex create lexical analyzers in the C programming language. The majority of users of Luthorj are expected to be familiar with Lex, and Luthorj parses input files that are largely the same as Lex files. However, Luthorj is not merely a look-alike, Java version of Lex. The functionality of Luthorj is partly compatible with that of Flex, but Luthorj and Flex use different methods to provide similar functionality. The lexical analyzers created by Luthorj convert textual strings into tokens that, in turn, can be fed to parsers created by the Saxj program described in the preceding article. Luthorj converts input string specifications to lexical-analysis data structures by use of an algorithm that converts regular expressions to nondeterministic finite automata (NFA). The NFA are then mapped to deterministic finite automata (DFA). The combination of all DFA are represented as a transition table, which is stored in a file. The outputs of Luthorj are the transition table and the code to use it.
- Citation
- "Program Creates Java Lexical Analyzers," Mobility Engineering, May 1, 2001.