[antlr-interest] Nondeterminism and syntantic/semantic predicates info
Joan Pujol
joanpujol at gmail.com
Thu Aug 5 08:26:16 PDT 2004
On Wed, 4 Aug 2004 15:38:37 -0700, Monty Zukowski
<monty at codetransform.com> wrote:
> On Aug 4, 2004, at 1:26 PM, Joan Pujol wrote:
> Some nondeterminisms are acceptable, for instance the if/else
> ambiguity. It truly is non-deterministic. However, the code that
> ANTLR generates handles it the way you would expect. Being
> nondeterministic means that ANTLR can't predict which alternative to
> choose because of overlapping lookahead sets.
Yes, my grammar is nondeterministic (i think)
multiple_assignment: "<" identlist ">" "=" <" expresionlist ">"
The non determinism is with the ">" of the final of
multiple_assignment and the ">" operator of greater of expression.
But I have put some semantical predicate in the grammar. And what I
want to know is the logic that ANTLR uses when you put semantic
predicates:
Ohh, a semantic predicate, no problem with nondeterminism, the user solve it.
or
A semantic predicate, well It seems that is well but anyway I am going
to give a warning to the user to be sure.
> You could give Ter's PhD Thesis a read (on antlr.org,) it sure gives a
> lot of detail on lookahead computations.
I will try to look it. But I don't know if I am to much newbie to understand it.
> Inspecting the code is the best bet. If you can tell that it will do
> the right thing then you can ignore the warning.
OK, a lot of thanks, If that I have done and it seems that the code is good.
Cheers,
--
Joan Jesús Pujol Espinar
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list