When a grammar is compiled, each component in the translator is constructed.
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.
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
.
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
.
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.
Fig 3: Schematic showing how a Translator
is constructed.
Go to the first, previous, next, last section, table of contents.