[antlr-interest] Nondeterminism warnings upon Lexer and Grammar

Herumor herumor at fastwebnet.it
Tue Jul 25 11:37:10 PDT 2006


Hello everyone,
this is my first post here I hope I'll get some help.
Here there are my parser and lexer:
http://www.rafb.net/paste/results/CErdtH29.html
http://www.rafb.net/paste/results/Mslbw522.html

----------Warnings-------------------------
1)

[code]C:\Documents and
Settings\spotted\Documenti\grammatica\codice_generato>java antl
r.Tool EasyJavaParser.g
ANTLR Parser Generator   Version 2.7.6 (2005-12-22)   1989-2005
EasyJavaParser.g:86: warning:nondeterminism between alts 1 and 2 of
block upon
EasyJavaParser.g:86:     k==1:Type
EasyJavaParser.g:86:     k==2:Identifier
[/code]

2)
[code]
C:\Documents and
Settings\spotted\Documenti\grammatica\codice_generato>java antl
r.Tool EasyJavaLexer.g
ANTLR Parser Generator   Version 2.7.6 (2005-12-22)   1989-2005
error: Lexer rule ESC is not defined
EasyJavaLexer.g: warning:lexical nondeterminism between rules
AccessSpecifier an
d ReturnType upon
EasyJavaLexer.g:     k==1:'f','s','v'
EasyJavaLexer.g:     k==2:'o','y'
EasyJavaLexer.g:     k==3:'a','i','l','n','o','t'
EasyJavaLexer.g:     k==4:'a'
EasyJavaLexer.g: warning:lexical nondeterminism between rules
AccessSpecifier an
d Type upon
EasyJavaLexer.g:     k==1:'f','s'
EasyJavaLexer.g:     k==2:'o','y'
EasyJavaLexer.g:     k==3:'a','l','n','o','t'
EasyJavaLexer.g:     k==4:'a'
EasyJavaLexer.g: warning:lexical nondeterminism between rules ReturnType
and Typ
e upon
EasyJavaLexer.g:     k==1:'b'..'d','f','i','l','s'
EasyJavaLexer.g:     k==2:'h','l','n','o','y'
EasyJavaLexer.g:     k==3:'a','l','n','o','t','u'
EasyJavaLexer.g:     k==4:<end-of-token>,'a','b','e','g','r'
Exiting due to errors.
[/code]

They are the 2 errors that I'm getting.
I'd like to know if I can safely disable  the warning in the case of the
parser and if yes how if not is there a solution?
In the case of the Lexer I have no idea why there's nondeterminism and
I'd like someone to explain me.



More information about the antlr-interest mailing list