I copy-pasted the addr-spec grammar from rfc5322 and was converting it to Xtreams format. One PITA was converting all the decimal values to hex e.g. "%d97" -> "\x000061". I wanted to extend the Xtream grammar to handle "/d97". I extended PEGParserGenerator and PEGParserParser with the following:
Escape: backslash character: character hexes: hexes
...
character = $d ifTrue: [^(String withAll: hexes) asNumber asCharacter]
But I couldn't figure out how to put this extension into action. PEGParser>>parserBootstrap has a comment "This method was generated with the following code: PEGParser parserPEG parse: 'Grammar' stream: PEGParser grammarPEG actor: PEGParserGenerator new", but evaluating that after extending produced the same output as the original. What am I missing? Thanks.
Cheers,
Sean