May 6, 2008
Angel Herranz
Writing a language processor from scratch is a daunting task; it requires knowledge of specialised techniques and a considerable amount of time and intellectual effort. Parser generators like Yacc and its heirs generate parsers from BNF grammars restricted by the parsing method. The remaining phases of the processor are hardwired in semantic actions hooked on grammar productions which, together with error-recovery stuff, clutter up the grammar and render it unmanageable and unmaintainable.
I’ll talk about Generalised Object Normal Form (GONF) and MTP, a syntax formalism and its related tool where grammatical productions simultaneously specify parseable concrete syntax (ie, a language and its parser) and the collection of language-independent data type definitions that represent the AST, which can be materialised without annotations in target languages supporting inheritance or algebraic types and, desirably, parametric polymorphism.
Angel and Pablo.