[antlr-interest] Re: syn pred / lookahaed doesn't work
lgc at mail1.jpl.nasa.gov
Tue Mar 11 17:03:16 PST 2003
This is one of those situations where recursion works. Try
(statement)=> (statement statementList)
--- In antlr-interest at yahoogroups.com, "Gunnar Wagenknecht"
<kreismeister at y...> wrote:
> I have a grammar where the syn. pred. doesn't seem to work. I can
> post the whole grammar but the following example should be ok to
> recognize the problem.
> compilationUnit : statementList (function)*;
> function : ("static"|"init"|"exit")? "function" identName crlf
> identName : IDENTIFIER;
> crlf : SEMICOLON | NEWLINE;
> statementList: (statement)*; // <<< here I get non-determinisme
> // warning upon
> // k=1 "static"|"exit"
> // k=2
> statement: ...
> | variableDeclaration
> | ...
> | "exit" crlf
> | ...
> variableDeclaration : ("public"|"private"|"local"|"static")
> I tried to reslove things with syn. pred. but whatever I do I
> couldn't remove the warning. The generated parser also doen't work
> What can I do to resolve the warning?
> Thanks, Gunnar
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest