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
--
View this message in context: 
http://forum.world.st/Xtreams-Extending-Bootstrap-tp4902579.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply via email to