I'm lost on how to correctly write my grammar with backtracking off. It
seems relatively simple but I didn't find anything in the archive, or in
TDAR.
This is C#/Java grammar and I'm stuck on the relational_expression which
conflicts with the syntax for generics.
Valid input can be *a < b;* or *a<T> < b;*
So at the '<' it doesn't know if it should look for a generic type (and
types don't have to be defined ahead of time) or look for the right hand
side of the expression. I basically want to know if there's a matching '>'
in the future or not.
Here's the simplified grammar sans the lexer bits.
relational_expression: // non-LL(*) decision blah blah blah
type ('<' type)* ;
// type ('@' type)* ; // works fine
generic_argument_list:
'<' type '>' ;
type:
identifier generic_argument_list? ;
How should I fix this?
Thanks,
--
/Andrew
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.