Using PetitParser2 to parse PEGs, with a view to automatically generating parsers to parse the grammars they describe
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.
- Extensions to automagically create parsers from PEGs, rather than just parsing them