Home

Awesome

This is a modified version of Go package peg, written by pointlander, for the purpose of supporting LEG grammars, a variant of PEG grammars as defined in peg(1). See README.orig for the original README.
If you do not intend to use a LEG grammar, please take a look at the original package instead.

The subdirectory cmd/leg contains source files for the LEG parser. Using this parser, the peg-markdown package, which contains a LEG definition, has been ported to Go.

To download and install, run

go get github.com/knieriem/peg

Run make or make prepare to bootstrap the peg parser, and to create the leg parser and the example parsers. There should be a binary peg in ./cmd/peg now.

To delete the generated source files and binaries that are not part of the project, run make clean.

The desk calculator example from peg(1) can be built by typing go build in directory ./cmd/legcalc.

The parser generators now take on option -O to turn on various optimizations, with a single argument consisting either of a number of colon-separated flags, or the string "all". For the possible values of these flags, see util.go.

Summary of other modifications:

--
Michael Teichgräber