[antlr-interest] C grammar example from the site
bbrown
bbrown at botspiritcompany.com
Mon Dec 3 15:58:55 PST 2007
I was having trouble generating the C grammar from the site.
"ANSI C grammar for ANTLR v3
Terence Parr Wed Jul 19, 2006 18:18
Haven't tested a bunch, but it's a good start. :)"
I downloaded the C.g file and did the following.
LIB1=${LIB}antlr-3.0.1.jar
LIB2=${LIB}antlr-runtime-3.0.1.jar
LIB3=${LIB}stringtemplate-3.1b1.jar
LIBb=${LIB}antlr-2.7.7.jar
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
warning(200): c.g:455:38: Decision can match input such a
le alternatives: 1, 2
But I don't get a Parser File? is it supposed to generate a parser so that I
can process the tokens?
Here are the classes that are generated.
CParserLexer$DFA25.class CParserLexer.class
CParserLexer$DFA35.class ParseMain.class
--
Berlin Brown
[berlin dot brown at gmail dot com]
http://botspiritcompany.com/botlist/?
More information about the antlr-interest
mailing list