[antlr-interest] How to remove the rules ambiguity here?

Michael LeBlanc Mike at LeBlanc-Engineering.com
Mon Oct 29 03:12:59 PDT 2007


I don't know anything about C# but, if the target were Java, I would  
try the following change to compare strings, not references to them.

On Oct 28, 2007, at 1:37 PM, Johannes Luber wrote:

> // For contextual keywords like get, set and yield
> contextual_keyword[string identifier]
> 	:	 { input.LT(1).Text == $identifier }? IDENTIFIER
> 	;

becomes

> // For contextual keywords like get, set and yield
> contextual_keyword[string identifier]
> 	:	 { input.LT(1).Text.equals($identifier) }? IDENTIFIER
> 	;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20071029/3e0e98a3/attachment.html 


More information about the antlr-interest mailing list