[antlr-interest] nondeterminism warning?
dima
dimax at gmx.de
Tue Jan 24 14:09:41 PST 2006
First of all, sorry for my english,
I have a problem with my C# grammer. It has non
keyword literals and if I try too add this words to
identifier, I become this warning
her's simplified part of my grammer:
------------------------------
nonKeywords
: "assembly" | "type" ;
identifier
: real_identifier | n:nonKeywords { #n.setType(ID); } ;
real_identifier!
: ID ;
c_unit
: (global_attributes)* (class_declaration)* ;
class_declaration
: (attributes)? "class" identifier SEMI! ;
global_attributes!
: LBRACK "assembly" COLON attribute_list RBRACK ;
attributes
: (attribute_section)+ ;
attribute_section!
: LBRACK ("type" COLON)? attribute_list RBRACK ;
attribute_list
: attribute (COMMA! attribute)* ;
attribute!
: identifier (attribute_arguments)? ;
attribute_arguments
: LPAREN! (attribute_argument_list)? RPAREN! ;
attribute_argument_list
: identifier (COMMA! identifier)* ;
-------------------------------
With this part, I become this warning:
nondeterminism upon k==1:LBRACK k==2:"assembly" between alt 1 and exit branch of block
Without "assembly" in nonKeywords it works fine,
without global_attributes rule it works fine,
and without attributes rule it works fine too,
but all three together not.
Please help my to fix it.
Thanks!
Dima.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060124/15828b0e/attachment.html
More information about the antlr-interest
mailing list