PEG Builder
PEG Engine

The core of this project is our
PEG engine; a so called packrat parser with:
recursion detection
- advanced error reporting
- memoization
- ability to record parsing steps (for enabling DEBUG)

With the grammar definition (APT, Abstract Parser Tree) the parser is able to create an AST (Abstract Syntax Tree) representing the given input. Users can use this tree for creating compilers or analyzers.
The PEG engine understands a PEG grammar (originally created by Brian Ford and extended by us) that permits users to set:
use of memoization (memoization can use a lot of memory but without it the parser could be slow, the memoization process permits to save the result of a rule execution in a certain point of the analyzed file)
case sensivity (some programs don't need to take care about letters case)
descriptive errors for rules (better error reporting using descriptions instead of rules)
ability to ignore the result of some rules when creating the AST tree (spaces, comments and others can be ignored)
ability to raise a blocking error if a rule fails or succeeds (some rules can block the parsing)
Copyright 2002-23 by Lorenzi Davide. All rights reserved.
Site built with Dynamic HTML Editor