[antlr-interest] Error in 3.0b4?

Terence Parr parrt at cs.usfca.edu
Sun Oct 22 12:47:07 PDT 2006


oh, it's due to just .* in a grammar, which cannot throw an  
exception.  .* will never terminate by the way.
Ter
On Oct 22, 2006, at 11:18 AM, Robert Baruch wrote:

> Hi all,
>
> Here is a grammar which seems to generate invalid Java code:
>
> grammar TestParser;
> @parser::header { package generated; }
> @lexer::header { package generated; }
>
> start : r0 EOF;
> r0 : (.) * ;
>
> N : 'n';
> V : 'v';
>
> Compiling the result gives the following error:
>
> generated/TestParser.java:92: exception  
> org.antlr.runtime.RecognitionException is never thrown in body of  
> corresponding try statement
>         catch (RecognitionException re) {
>         ^
> 1 error
>
>
> Again, granted it's a stupid grammar, but it's a valid grammar and  
> should generate valid code :)
>
> Any chance of a quickfix?
>
> Thanks,
>
> --Rob
>



More information about the antlr-interest mailing list