Skip to content

taruti/peg

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Peg, Parsing Expression Grammar, is an implementation of a Packrat parser
generator. A Packrat parser is a descent recursive parser capable of
backtracking. The generated parser searches for the correct parsing of the
input.
For more information see:
 http://en.wikipedia.org/wiki/Parsing_expression_grammar
 http://pdos.csail.mit.edu/~baford/packrat/
This Go implementation is based on:
 http://piumarta.com/software/peg/


Files

bootstrap/main.go: bootstrap syntax tree of peg
peg.go: syntax tree and code generator
main.go: bootstrap main
peg.peg: peg in its own language


Building

make


Testing

There should be no differences between the bootstrap and self compiled:

./peg -inline -switch peg.peg
diff bootstrap.peg.go peg.peg.go

"-inline" tells the parser generator to inline parser rules. "-switch"
reduces the number of rules that have to be tried for some pegs.


Author

Andrew J Snodgrass
andy@pointlander.info

About

Peg, Parsing Expression Grammar, is an implementation of a Packrat parser generator.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%