[antlr-interest] C TARGET: Strange No Viable Exception

register register72 at gmail.com
Mon Mar 26 11:10:27 PDT 2012


I have just discovered another detail that could be useful to troubleshoot
the issue:

when I create the lexer stream directly from an input file using
"antlr3FileStreamNew" I get no error at all;
when I use antlr3StringStreamNew to create the stream from a string in
memory I get the No viable exception.

Luca


On Mon, Mar 26, 2012 at 7:28 PM, register <register72 at gmail.com> wrote:

> Hi all,
> I have an antlr generated C  lexer that keeps on throwing several  "No
> Viable Exceptions" just at the end of the file. I have developed the
> grammar in AntlrWorks and the Java Lexer doesn't have any trouble at all.
> The  ANTLR3_EXCEPTION struct passed to the "
>
> displayRecognitionError" method does not carry any useful information:
>
> - expecting, token and expectingSet are all null
> - there is a mysmatch between the type and name field: type is 3
> (ANTLR3_NO_VIABLE_ALT_EXCEPTION) and name is
> "org.antlr.runtime.RecognitionException".
>
>
> However it seems that the grammar is always able to complete a successful
> parse of the files. I have made several attempts with various input and the
> results I get are always correct. Still this "No Viable Exceptions" is
> pretty annoying.
> How could I debug this issue?
>
> Regards,
> Luca
>
>
>
>
>
>
>


More information about the antlr-interest mailing list