[antlr-interest] again nondeterminism problem
mzukowski at yci.com
mzukowski at yci.com
Mon Dec 15 09:18:49 PST 2003
MSG_DIR and MSG_TYPE share a common prefix of '[', so you need to combine
them into one rule, something like
MSG_DIR
: '['
("in" | "out")
|("asyn" | "sync") {$setType(MSG_TYPE);}
']'
;
Monty
-----Original Message-----
From: vincedupuis [mailto:vincedupuis at yahoo.ca]
Sent: Monday, December 15, 2003 8:23 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] again nondeterminism problem
I understand the problem of nondeterminism.
But I don't know how to solve it.
I have the following rules in my parser:
IDENT
: ('a'..'z' | 'A'..'Z' | '_') ('a'..'z' | 'A'..'Z' | '_' | '0'..'9')
*
;
MSG_DIR
: '[' ("in" | "out") ']'
;
MSG_TYPE
: '[' ("asyn" | "sync") ']'
;
of course I got the following warning:
warning:lexical nondeterminism between rules MSG_DIR and MSG_TYPE
upon k==1:'['
Note: I want to be able to use the words (in, out, async, sync) as
an IDENT also.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list