[antlr-interest] help on warning:nondeterminism upon

Alexey Demakov demakov at ispras.ru
Thu Oct 14 06:09:59 PDT 2004


Hi,

1. setError alternative in createPolicyParams and createPolicyTypes allows ALPHANUM,
so parser can't decide when createPolicyParams ends and createPolicyTypes starts.
I suspect that setError is only for error handling and can't be removed.
It solves your problem. Additional remarks:
2. k = 9 in parser and k = 20 (!!!) in lexer are unnecessary.
3. Try to skip whitespaces as Martin Probst advises.
4. Try to use tokens {}for literals. If you need some optional letters at the end of keyword, you can parse it as different tokens
and reassign token types later.
Or use parser rules like this:
switch : SWITCH | SWIT | SWI;
When k = 20 antlr doesn't stop :)

Regards,
Alexey
-----
TreeDL: Tree Description Language: http://treedl.sourceforge.net
RedVerst Group: http://www.unitesk.com

----- Original Message ----- 
From: "s2jafer1" <s2jafer1 at yahoo.com>
To: <antlr-interest at yahoogroups.com>
Sent: Wednesday, October 13, 2004 10:38 AM
Subject: [antlr-interest] help on warning:nondeterminism upon


>
>
>
>
> I am getting the " warning:nondeterminism upon "
>
> in the line no 244,it corresponds to
>
> "createPolicy throws ArchiveSystemApplicationException
>     :
>     CREATE WS POLICY ( WS createPolicyParams)* ( WS
>
> createPolicyTypes)* NEWLINE  in the source code" during compilation
>
> of the grammar file.i want to avoid this warning .
>
> if anybody knows the solution let me know as soon as possible.




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list