Elkhound: A GLR Parser Generator
Friday, April 23rd, 2004Thanks to David Wagner for a pointer to Elkhound, which is a GLR (Generalized LR) parser generator. It can generate parsers in C++ and OCaml, and includes Elsa, a grammar for C++.
Thanks to David Wagner for a pointer to Elkhound, which is a GLR (Generalized LR) parser generator. It can generate parsers in C++ and OCaml, and includes Elsa, a grammar for C++.
Thanks to Mykola Rabchevskiy for a pointer to Coco/R, a scanner/parser generator from the University of Linz. It generates source for C# and Java; there are also (apparently unsupported) versions that generate code for Oberon, Pascal, Modula-2, C, C++, Delphi, and Unicon. Coco/R generates recursive descent parsers and scanners from an attributed grammar and is distributed under the GNU GPL.
The SableCC parser generator is a tool for compiler developers who use Java. From the web page:
SableCC is an object-oriented framework that generates compilers (and interpreters) in the Java programming language. This framework is based on two fundamental design decisions. Firstly, the framework uses object-oriented techniques to automatically build a strictly typed abstract syntax tree. Secondly, the framework generates tree-walker classes using an extended version of the visitor design pattern which enables the implementation of actions on the nodes of the abstract syntax tree using inheritance. These two design decisions lead to a tool that supports a shorter development cycle for constructing compilers.
SPARK is a “Scanning, Parsing, and Rewriting Kit,” enabling the construction of interpreters and compilers for “little” or domain-specific languages in Python. It appears to be fairly widely used; the author has used it for “a compiler for Guide, compiling a subset of Java, an experimental type inferencer for Python, and probably a few other things I’ve forgotten.”
treecc is a tool for building programs that operate on trees (as such, it does not fit neatly into the two “Tools:” categories I have placed it in). It will generate code for C, C++, C#, and Java, and is notable for its aspect-oriented approach to compiler construction.
The ANTLR Parser Generator and Translator Generator is a well-regarded tool to aid in generating compiler frontends in Java, C# or C++. From the web page:
ANother Tool for Language Recognition, (formerly PCCTS) is a language tool that provides a framework for constructing recognizers, compilers, and translators from grammatical descriptions containing Java, C#, or C++ actions. ANTLR provides excellent support for tree construction, tree walking, and translation.
Thanks to Mulhern for the suggestion.