Pegleg Generator

Ian Piumarta created peg and leg which are tools for generating recursive-descent parsers: programs that perform pattern matching on text. page

They processes PEG Grammars to produce programs that recognize legal sentences of those grammars.

peg processes PEGs written using the original syntax described by Ford; leg processes PEGs written using slightly different syntax and conventions that are intended to make it an attractive replacement for parsers built with lex and yacc.

Unlike lex and yacc, peg and leg support unlimited backtracking, provide ordered choice as a means for disambiguation, and can combine scanning (lexical analysis) and parsing (syntactic analysis) into a single activity.

.

We use a fork of PegLeg that recognizes extra grammar symbols for adding matches to the Regrade Tally. github

These symbols, << ... >> and <<< ... >>>, are called Eyeballs because they look vaguely like eyes and give visibility into the parsing matches.