[antlr-interest] Diferent output when running ANTLRWorks IDE and a test rig in both Java and C# versions

Jim Idle jimi at temporal-wave.com
Fri Apr 8 09:14:19 PDT 2011


Well the hint is that your grammar is wrong.

But you need to post your grammar to get more help :-). I think, from the
way you describe your problem, that perhaps you have ambiguous lexer rules
and think that the parser influences what lexer rule is run, which it does
not.

Also, make sure you run the debugger in AntrlWorks and check any warning
messages when you generate the code.

Jim



> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Hélder Silva
> Sent: Friday, April 08, 2011 3:46 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] Diferent output when running ANTLRWorks IDE
> and a test rig in both Java and C# versions
>
> I’m getting different results when i run a certain input on the IDE in
> comparison to a test rig in either Java or C# as well.
>
>
>
> In the IDE, for a given input, I get a NoViableAltException, which is
> what I want to happen.
>
>
>
> When running the same input on Java test rig I get this:
>
> line 1:3 mismatched character ' ' expecting '@'
>
> line 1:4 required (...)+ loop did not match anything at input 'helium'
>
> The “expecting ‘@’” i suppose the parser is looking for another token I
> have in which it matches an email address, but no rule I have starts
> with an email address either.
>
>
>
> In the C# test rig, the parser complains there is no input with the
> message:
>
> line 1:4 required (...)+ loop did not match anything at input 'helium'
>
> can someone give me a hint on what’s happening here?
>
>
>
>
> 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