[antlr-interest] creating root nodes in rules

Tarun Khanna tarunkhanna at gmail.com
Tue Jul 26 12:46:17 PDT 2005


consider the following grammar

some_expr:
id 
(
DOT^ id
|!
LPAREN expr RPAREN
{
#[APPLY, "FuncCall"];
}
)*


you see how the first option creates DOT as the root node for the tree 
constructed so far. I need to do something similar for the second option 
however I need to create a new node and then make it the root exactly like 
DOT is made root in the previous alternative. Any idead how this can be 
done?

Thanks
-- 
Tarun Khanna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20050726/375dd424/attachment.html


More information about the antlr-interest mailing list