My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members

QPeg is a parser generator for parsing expression grammars (see here). It takes a grammar as its input and generates code for a corresponding packrat parser.

The grammar syntax somewhat resembles that of ANTLR, and the parser generator has some useful features:

  • Code generated in C++, Java or Kalimat.
  • A cut feature to enhance performance and enable better error handling, inspired by this paper (pdf, abstract here).
  • Ability to return parse trees via actions embedded in the grammar.
  • Support for semantic predicates.
  • Budding/experimental support for higher-order grammar rules, via a special 'Apply' operator.
  • A special 'snippet' operator that can parse a complex rule and return the parsed portion of the input buffer as a single token; useful for things like template engines.

The program is still in early stages of development, but it has already bootstrapped itself: QPeg uses code generated by itself to parse the PEG grammar used as its input!

(Basic user documentation here)

Powered by Google Project Hosting