[antlr-interest] Tree Grammar Syntax?

Foust javafoust at gmail.com
Wed Aug 6 01:50:15 PDT 2008


The DAR is pretty sparse about the details of using a tree grammar for more
than anything but the simplest cases of printing some nodes. 

 

(1)    Can subtrees be matched optionally? (Like the T_MODIFIERS subtree
below)

 

stmt       : ^(T_REFERENCE  IDENTIFIER param? ^(T_MODIFIERS modifiers)?
n+=IDENTIFIER*) ;

 

or is this explicitly forbidden, requiring the subtree expression to be
broken out into a separate rule?

 

(2)    How are the * and + expressions accessed? Is the += operator used to
turn them into an ArrayList, just like in the parser?

 

Brent

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080806/2ca1be02/attachment.html 


More information about the antlr-interest mailing list