[antlr-interest] C grammar example from the site (bbrown)

Ramon Verbruggen Ramon.Verbruggen at quintiq.com
Tue Dec 4 00:10:50 PST 2007


> I was having trouble generating the C grammar from the site.
>
> java -classpath $CP1 org.antlr.Tool c.g
>
> At this point, things look ok:
>
> ANTLR Parser Generator  Version 3.0.1 (August 13, 2007)
>error(8):  file c.g contains grammar CParser; names must
>
It's a hint! ANTLR is telling you that it does not expect a grammar
named CParser in a file called c.g, so you should rename your file to
CParser.g or rename your grammar to c.


>warning(200): c.g:455:38: Decision can match input such a
>le alternatives: 1, 2
>
Since this is a warning I would expect a parser to be generated after
you changed either the filename or the name of the grammar.

I hope this helps,

Ramon Verbruggen



This message contains information that may be privileged or confidential
and is the property of Quintiq. It is only intended for the person to
whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain, copy, disseminate, distribute or use
this message or any part thereof. If you have received this message in
error, please notify the sender immediately and delete all copies of
this message. Please note that e-mails are susceptible to change,
therefore they are not binding.


More information about the antlr-interest mailing list