[antlr-interest] nondeterminism issue
Michiel Vermandel
Michiel_Vermandel at axi.be
Thu Jul 6 08:03:57 PDT 2006
Hi,
I get quite some warnings when parsing my grammar and I'm trying to
understand why.
I started with the lexer and I isolated one warning.
My lexer is now reduced to: see below.
When I parse this grammar file I get:
ANTLR Parser Generator Version 2.7.5rc2 (2005-01-08) 1989-2005
jGuru.com
FormsLexerSnip.g:17:35: warning:lexical nondeterminism between alts 1 and
2 of block upon
FormsLexerSnip.g:17:35: k==1:'\n'
FormsLexerSnip.g:17:35: k==2:<end-of-token>,'\t','\n','\r',' '
FormsLexerSnip.g:17:35: k==3:<end-of-token>,'\t','\n','\r',' '
FormsLexerSnip.g:17:35: k==4:<end-of-token>,'\t','\n','\r',' '
Press any key to continue . . .
Can anyone explain me why I get this warning?
Thanks
Michiel
Lexer:
----------------------------------------------------------------
class FormsLexer extends Lexer;
options {
exportVocab = Forms;
testLiterals = false;
k = 4;
caseSensitive = false;
caseSensitiveLiterals = false;
charVocabulary = '\3' .. '\177';
}
WS : ( ' '
| '\t'
| ('\n'|'\r'('\n')?) {newline();}
)+
{ $setType(Token.SKIP); }
;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060706/b65c4aa4/attachment.html
More information about the antlr-interest
mailing list