[antlr-interest] warning:lexical nondeterminism question
Octavian Nita
octavian_nita_2004 at yahoo.com
Sun Jun 19 01:26:49 PDT 2005
Hello everyone!
I've read Nigel's answer to the question, and I
totally agree with it.
My first thought was indeed to try to change
(DIGIT)? DIGIT DIGIT
to
DIGIT DIGIT (DIGIT)?
because this is mere syntax, and not semantics; you
actually need 'at least 2 digits, but 3 is also ok, I
have something else'; the parser is not the place to
worry about 'the meaning of things' (semantics).
What I am trying to say is that I think you had in
mind what that rule (sentence) means and now how to
recognize it, while parsing is just that: how to
recognize at least 2 and at most 3 digits. Later I
think is the time to ask yourself whether you have 2
or 3 digits...
Of course, my thoughts may be wrong and also my
explanation, so I do apologise if I am mumbling
without a sense...
Anyway, I think Nigel's answer is more complete and
better than mine (it actually brings out solutions,
and not theory); these were just thoughts...
With respect,
Tavi
____________________________________________________
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football
http://football.fantasysports.yahoo.com
More information about the antlr-interest
mailing list