So, starting from a basic grammar that parses the two kinds of time expression,
I tried to add the ability to add two intervals. I attempted to follow the
example in the book for the expr language. Here's my grammar (the lexer/parser
is concatenated below the tree grammar):
http://pastie.org/private/k9holwmls7emhfpgzo1oxw
If I uncomment line 15, it complains that:
[20:34:25] Checking Grammar TimeEval.g...
[20:34:25] warning(200): TimeEval.g:34:4: Decision can match input such as "INT
INT" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
[20:34:25] warning(200): TimeEval.g:34:3: Decision can match input such as
"INT" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
With line 15 commented out, it works great, but I need to understand why it
becomes ambiguous with the sum operation in there, and how to fix it, so that I
can add some other operations.
I feel like I need to do something to let the tree walker know when it hits an
RTL expression, but I wasn't able to just insert a token into the stream as I
have wanted to do more than once.
Thanks much!
--
Rick
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.