[antlr-interest] ANTLR 3.4 not generating compilable Parser file Java target

Terence Parr parrt at cs.usfca.edu
Tue Jul 24 11:54:30 PDT 2012


Sorry. This is fixed in 3.4.1. I really need to get this version pushed out, but I am underwater trying to work on v4 and launch a new graduate program next week. ugh! You can grab the source from 

https://github.com/antlr/antlr3/downloads

 and build it

T
On Jul 24, 2012, at 8:42 AM, Karishma Chadha wrote:

> Hello,
> 
> I have been using ANTLR 3.4 to generate a Lexer and Parser for my language
> in a Java target. Yesterday, I got a compiler error when trying to compile
> my generated parser file which looks like this:
> 
> VenthonParser.java:9621: illegal start of expression
>        void  =null;
>        ^
> VenthonParser.java:9692: illegal start of expression
>        void  =null;
>        ^
> 
> One of the corresponding chunks of code in the Parser is as follows (the
> other one is similar):
> 
> public final void synpred81_Venthon_fragment() throws RecognitionException
> {
>        void  =null;
> 
> 
>        // Venthon.g:585:5: ( ( PLUS | MINUS ) b= term )
> 
> 
>        // Venthon.g:585:5: ( PLUS | MINUS ) b= term
> 
> 
>        {
>        if ( input.LA(1)==MINUS||input.LA(1)==PLUS ) {
>            input.consume();
>            state.errorRecovery=false;
>            state.failed=false;
>        }
>        else {
>            if (state.backtracking>0) {state.failed=true; return ;}
>            MismatchedSetException mse = new
> MismatchedSetException(null,input);
>            throw mse;
>        }
> 
> 
>        pushFollow(FOLLOW_term_in_synpred81_Venthon1835);
>        b=term();
> 
>        state._fsp--;
>        if (state.failed) return ;
> 
>        }
> }
> 
> 
> I have seen some of the other messages on the ANTLR mailing list saying
> that this is a known issue in ANTLR 3.4 that was fixed but then backed out
> again. Is there any solution to this even if it is just a temporary one
> until the next release? I would prefer not to have to switch to a previous
> version of ANTLR if that can be avoided. I need to continue using ANTLR in
> my project and I am on a tight deadline.
> 
> Please let me know if there are any solutions.
> Thank you!
> 
> -- 
> *Karishma Chadha*
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list