You have a spurious single quote at the end of this line:

| 'if' expression 'then' single_command 'else' single_command'
                                                             ^

I suggest that you don't use inline 'literals' in the parser, create lexer 
tokens for them all - when you are starting out, they tend to get you in to 
trouble :-)

Jim


> -----Original Message-----
> From: [email protected] [mailto:antlr-interest-
> [email protected]] On Behalf Of Alexandru Nedelcu
> Sent: Monday, November 23, 2009 2:44 AM
> To: [email protected]
> Subject: [antlr-interest] Strange grammar errors
> 
> I'm reading "Programming Language Processors in Java" while
> experimenting with Antlr at the same time, and I tried converting the
> first example of a BNF specification to Antlr.
> 
> See here (the lines with errors reported are highlighted) ...
>     http://pastebin.com/m51e453e4
> 
> As you can see it is very simple, and I eliminated left-recursions, but
> I'm getting the errors posted here ...
>     http://pastebin.com/m54d656a6
> 
> I'm using Antlr 3.2 and ANTLRWorks 1.3.1 for editing. Antlrworks says
> that the grammar is OK, until I try compiling it.
> 
> I don't really know what I'm doing wrong, is this a bug? It looks like
> an Antlr syntax-error, but I couldn't figure it out.
> 
> Thanks,
> 
> 
> --
> Alexandru Nedelcu
> http://alexn.org
> 
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address




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

--

You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
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=.


Reply via email to