[antlr-interest] Don't know some tree walker rules for specific parser rules

Jens Boeykens jens.boeykens at gmail.com
Mon Jul 14 08:27:26 PDT 2008


Hi,

What should be the walker rules for:

*A) r: (id -> id) ('+' id -> ^('+' r id))*;
B) r: (id -> ^(ARG id)) ('+' id -> ^('+' $r id))*;
C) r: (id -> ^(ARG id)) ('+' id -> ^('+' BLOCK id));*
*
*My suggestions:
A) r: id | ^('+' r id)*;
B) r: ^(ARG id) | ^('+' r id)*;
C) r: ^(ARG id) ^('+' BLOCK id);

Are these correct? Note that first 2 rules are using recursion and the third
does not.

Jens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080714/0276bd8e/attachment-0001.html 


More information about the antlr-interest mailing list