Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
PEG parsing library for Open Dylan
Dylan
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
dylan-grammar-test
pl0-grammar-test
registry/generic Remove "dynamic-binding" from local registry.
.gitignore Add .gitignore.
.gitmodules
README.txt Added information about eliminating spurious errors.
library.dylan Implement parser attributes using OD's dynamic-bind.
parser-definers.dylan Fixed doc typos.
parser-functions.dylan
parser-rules.dylan Clean up whitespace.
parser-support.dylan Implement parser attributes using OD's dynamic-bind.
peg-parser.lid Don't build an executable for peg-parser.

README.txt

=== Library: Peg-parser ===

This is a memoizing (or, more correctly, caching) recursive descent parser
that handles attributed parsing expression grammars (PEGs), as described at
'http://en.wikipedia.org/wiki/Parsing_expression_grammar'.

It isn't too tricky to use. Basically, a PEG can act as both a lexical and
phrase grammar, and acts similarly to a forward-looking greedy regular
expression processor, except that it acts on tokens instead of characters.

This library allows for simple rules-based declarations and also custom parser
functions (you'll need some of these to get characters and literals from the
stream).

The parser can simplify and consolidate syntax elements in an upwards direction
along the syntax tree via token class slots, and downward or across the syntax
tree via dynamically-bound attributes. You can also define a context class to
keep global information for later semantic processing.

-- Dustin Voss


--- Compilation ---

Open Dylan currently has problems properly inferring types when compiling this
library into another project. It reports numerous spurious errors. To avoid
seeing these, pipe the compilation of libraries that 'use' [em] this library
through "egrep" [i] as follows:

| BASH: dylan-compiler ... 2>&1 | egrep -v '^$|^ |^[[:digit:]]|<parse-failure>|<parse-extent>'
| CSH:  dylan-compiler ... |& egrep -v '^$|^ |^[[:digit:]]|<parse-failure>|<parse-extent>'
Something went wrong with that request. Please try again.