IIRC, it actually fails to compile the grammar with an error. At worst it
should be a warning, but given the clear difference between "$expression"
and "expression", the behavior is clear enough that no warning should be
needed. In C# for example, the following does not result in a warning. I
don't see how this is any different. If a $$ token was added for referencing
the enclosing rule, then the warning could be brought back suggesting the
use of $$ instead of $expression.
class Test {
int field;
void Foo() {
int field = 3;
Console.Write(field);
}
}
Sam
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Jim Idle
Sent: Thursday, November 18, 2010 11:23 AM
To: [email protected]
Subject: Re: [antlr-interest] Ambiguous reference
It is a little overzealous in its warning but it isn't failing ;-)
The warning is telling you that it is picking the correct interpretation,
but the label of the rule reference should of course suppress the warning.
<snip>
Jim
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.