Greetings!

Hendrik Maryns asked:
> I showed you my grammar yesterday.  Now trying it out on some simple
> inputs blows me away right away: it doesn’t even parse anything.

Your problem seems to be with your Lexer rule for LABEL which is :

LABEL : ~(')')+ ;

this means that any sequence of characters that is not a ')' must be a LABEL.

another problem is that ')' is not matched by any Lexer rule. did you want 
OPEN and CLOSE to be parens?

> For example, if I give “(word x Einführung)” as input to the rule
> ‘formula’,

so all of the characters but the last are consumed as a LABEL token and we are 
left with a ')' which is not matched by any Lexer rule.

> I get MismatchedTokenException (0!=0).  Strangely enough, I
> do not think 0 is not equal to 0, but I have no idea what this is
> supposed to tell me.

I do not use AntlrWorks so can not help here. But I have seen similar messages 
when I have not re-compiled every source file after applying a change to a 
grammar.

> If I feed it to formulaList, I get an UnwantedTokenException followed by
> an EOF, which doesn’t make me any wiser at this point.

Yes. Confusing message. Which is just one of the reasons I do not use 
AntlrWorks.... (i assume you are using AntlrWroks? if so, maybe there is more 
useful information in the console window?)

When I use a command line based test setup, I get thus:

line 1:18 no viable alternative at character ')'
line 1:0 extraneous input '(word x Einführung' expecting EOF

> Grateful for any suggestions,
>.....remainder of message snipped....

Hope this helps
__
   -jbb


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-interest@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address

Reply via email to