[antlr-interest] antlrworks "NoViableAlt" exception

Jim Idle jimi at temporal-wave.com
Wed Nov 7 20:45:09 PST 2012


The interpreter is just a quick test of basic rules - it cannot do
anything complicated so it will get confused a lot. Just ignore the
interpreter and use the debug option, which will run the real thing. Also,
if you are building trees, then I would use real tokens in the lexer and
not 'literals' in the parser.

Jim

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Tom
Sent: Thursday, November 08, 2012 12:15 PM
To: antlr-interest at antlr.org
Subject: [antlr-interest] antlrworks "NoViableAlt" exception

Hello,

I am new to ANTLR, using version 3.4.

Does anybody have an idea what could be causing the following discrepancy:

When I use the GUI interpreter on an input I get some console errors
below.

Now I use the debugger on exactly the same input (copy/paste), the whole
thing works:  whole ASTree is built as I want it.

I have seen some posts about line ending characters and having to reset
the token stream, but this all doesn't seem to apply here, does it?


Thanks
Tom



console errors:
==
[20:01:04] Interpreting...
[20:01:04] problem matching token at 1:3 MismatchedTokenException(97!=34)
[20:01:04] problem matching token at 1:4 NoViableAltException('a'@[1:1:
Tokens : ( AND | COMMA | OR | T__26 | T__27 | T__28 | T__29 | T__30 |
T__31
| T__32 | T__33 | T__34 | T__35 | WS | Number | Exponent | String );])

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