[antlr-interest] Getting started with Java target?
Kevin Kelley
kkelley at adobe.com
Mon Jun 9 12:44:07 PDT 2008
Hello all,
I can¹t help but feel like there¹s something really obvious that I¹m missing
here, but I¹m driving myself ragged, so I figured I¹d ask.
I have used ANTLRworks (which is nice, by the way) to generate a Java lexer
and parser, and have gotten that code and the ANTLR runtime JAR into a
project of mine. What I want to do now is to get the tree produced by the
parser. Unfortunately, the ³how to use the Java runtime² section of the
website is incomplete, and all the examples I can Google my way to seem to
be for ANTLR 2 or to have other problems.
I have a parser, and am giving it the token stream from the lexer and then
invoking the method corresponding to the root rule on the parser, which
presumably parses the token stream. I think what I want to get out of the
parser is an ³org.antler.runtime.tree.CommonTree² or something similarbut I
can¹t for the life of me figure out how to get the tree out of the parser.
Any help would be much appreciated!
Thanks,
Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080609/7e76d907/attachment.html
More information about the antlr-interest
mailing list