[antlr-interest] Spam: Undocumented ANTLR 3.0b6 Message?

Jim Idle jimi at intersystems.com
Thu Feb 15 10:44:20 PST 2007


It is probably some not well defined diagnostic that will all be cleaned up once Ter can rewrite ANTLR3 using an ANTLR3 grammar and has more time to spend on error messages and so on. It means that DFA number 7 is not LL(*) ;-)

 

You are using backtracking=true, which can be very useful when grammars are very ambiguous (maybe regular expressions are a good example, I haven’t thought about it), but try to construct a parser that does not need this option, or just use it on rules that have no other option (which I see you are trying to do of course).

 

In the case of this rule, I think (without seeing what the other rules are)you can use:

 

perl_lpar_ere_expression 

: perl_lpar ere (RPAREN | ALTERNATE_PAREN)

;

 

Otherwise you are making the runtime code try to work out a way to parse your tokens to see if there is RPAREN or ALTERNATE_PAREN, when you can parser it more naturally and decide what to do in actions.

 

Jim

 

 

From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Bert Williams
Sent: Thursday, February 15, 2007 7:29 AM
To: antlr-interest at antlr.org
Subject: Spam:[antlr-interest] Undocumented ANTLR 3.0b6 Message?

 

Greetings:

 

Whilst adding even more complexity to the grammar upon which I am working, I got this message from the tool:

 

What does this mean?

 

 

The message came out after adding this fragment to my grammar.  I had to enable backtracking to get ANTLR to handle the tail

differences without complaining.

 

perl_lpar_ere_expression 

options{

backtrack=true;

}

:

     perl_lpar_ere RPAREN

    | perl_lpar_ere ALTERNATE_PAREN

          ;

 

perl_lpar_ere :  perl_lpar ere ;

 

Tool Message:

 

 

F:\regexparse\tregex>java org.antlr.Tool -o src\com\prosync\regexparse tregex.g

ANTLR Parser Generator  Version 3.0b6 (Jan 31, 2007)  1989-2007

non-LL(*) DFA 7

non-LL(*) DFA 7

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070215/71d2892d/attachment.html 


More information about the antlr-interest mailing list