[antlr-interest] lexical nondeterminism between IDENT & LABEL

John D. Mitchell johnm-antlr at non.net
Wed Nov 3 09:49:57 PST 2004


>>>>> "thoth2487" == thoth2487  <thoth2487 at libero.it> writes:
[...]

> Hi to all, I've a very simple language in which there are IDENTifiers and
> jump LABELs. An IDENTifier start with ('a'...'z')|('A'..'Z') and continue
> with ('a'...'z')|('A'..'Z')|('0'..'9') and a LABEL is like an IDENTifier
> but ends with a ':'. When I try following .g I obtain always a lexical
> nondeterminsim which I isn't to solve:

Stop trying to do that in the lexer.  Let the lexer return the ID for both
and then have your parsing rules distinguish between ID ":" being a label
or the ID is just an ID.

Take care,
	John


 
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