Enki - Code Generation
(Back to Enki Main)
Code Generation
In short, the entire grammar is compiled into a single class, in one output .d file. Each rule is a method in the parser class. Things like rule annotations are understood to be backed by the inherited class, or are otherwise within scope of the parser at compile time. ([Enki/Codegen More...])
Enki attempts to emit efficent code from the result of parsing EBNF and its custom annotations. The generated parser is non table based, and makes heavy use of labels and goto statements in order to move about the various terminals and conditions as quickly as possible. The generated code is also complete with debug statements, error statements (where possible) and is very human-readable.
