In fact the tree has been constructed by the leading (ID->ID), and that
parameter being a tree is exactly why I gave up on hoisting. I am sure it
can be made to work but getting the typing right was a pain.
So here is exactly what I am trying to do, there is probably a better way
than what I have (untested pseudo-grammer, but you should get the idea):
expr
: ( prefix -> prefix ) ( suffix -> /* *insert prefix as first child
of suffix and return suffix * */ ) *
prefix : ID;
suffix
: DOT ID -> ^( DOT ID )
| '[' expr ']' -> ^( INDEX expr )
I guess I could use a scope to pass down the prefix; or have suffix return
both the root type and a flat list and build the tree in expr; but both seem
painful to get right typing wise...
Franck
--
View this message in context:
http://antlr.1301665.n2.nabble.com/Possible-bug-with-backtrack-generated-predicate-methods-tp7033324p7033439.html
Sent from the ANTLR mailing list archive at Nabble.com.
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.