Is there a pattern to follow for creating tree grammars for subrules?
// parser rule. this works.
expression
: (a=term -> $a) ( ( '|' b=term -> ^(OR $expression $b)
| '|' -> ^(OR $expression EPSILON)
)
)*
;
// tree grammar 1, based on CMinus example in the book.Throws a
MismatchedTreeNodeException complaining about lack of
// 'UP' at SEQUENCE_EXPR
expression
: IF_ACTION
| ID
| ID ATTRIBUTES
| STRINGLITERAL
| EPSILON
| ^(GROUPED_EXPR expression)
| ^(OPTIONAL_EXPR expression)
| ^(SEQUENCE_EXPR expression)
;
Any pointers welcomed. Thx++
Jerry
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.