Go to the first, previous, next, last section, table of contents.


Compilation Model

When a grammar is compiled, each component in the translator is constructed.

Construction of LRTranslatorGrammar

The LRTranslatorGrammar is constructed via parsing of either a file in the native syntacs format or XML. If the parse is error-free, additional semantic checks are done to make sure that the grammar is internally consistent.

Construction of Lexical Analyzer

Each context in the LRTranslatorGrammar is transformed into a RegularGrammar instance, which is further transformed to a DFA. The DFA is then transformed (compressed) and integrated into the Lexer.

Construction of the Syntactic Analyzer

The LRTranslatorGrammar is used to build a ContextFreeGrammar which is then transformed into a deterministic pushdown automaton (DPA). The DPA is compressed and integrated into the Parser.

Construction of the LRTranslatorInterpreter

The LRTranslatorInterpreter is implemented by the grammar author and named in the compile-interpreter-classname property such that it may be reflected by the grammar compiler and integrated into the Translator. If no such property is given, a default LRTranslatorInterpreter is used.

construction

Fig 3: Schematic showing how a Translator is constructed.


Go to the first, previous, next, last section, table of contents.