Skip to content

Parsing PEGs eventually automatically make parsers

Notifications You must be signed in to change notification settings

johnhwoods/PegParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PegParser

Using PetitParser2 to parse PEGs, with a view to automatically generating parsers to parse the grammars they describe

Installing PegParser

I haven't worked out how to manage Metacello, so ... But this seems to work in a fresh image, it pulls in PP2 first

Metacello new
  baseline: 'PegParser';
  repository: 'github://johnhwoods/PegParser/src';
  load.

The comment for PegHandParser is a valid PEG - it is the PEG that defines PEGS with some additional PEG (ie #...) comments. So the raw parse can be obtain by inspecting the result of PegHandParser new parse: PegHandParser comment. Further processing of the AST is performed by the subclass PegHandEvaluator although at the moment this is just a few methods that flatten some of the ASTs.

Next Steps

  • Extensions to automagically create parsers from PEGs, rather than just parsing them

Need Help?

open an issue

About

Parsing PEGs eventually automatically make parsers

Resources

Stars

Watchers

Forks

Packages

No packages published