[antlr-interest] Can ANTLR transform AST to XML?

FC tangfc2001 at yahoo.com
Sun Mar 13 23:08:15 PST 2005


Hi, 

I am still confused with the problem to transform AST
to XML. Using Antlr I can get AST for Java code, while
serialization to XML is provided in the class of
XMLAST which is a derived class of class CommonAST.
Since base class can not be casted to its sub class,
how can I cast AST to XMLAST?

Ted

--- Terence Parr <parrt at cs.usfca.edu> wrote:
> On Mar 12, 2005, at 9:16 PM, FC wrote:
> > Hi,
> >
> > In my project, I want to use Antlr to parse my
> Java
> > source code to generate AST tree. But I want to
> store
> > AST in XML so that I can use this XML in my next
> > module of the project. I wonder if the current
> Antlr
> > can provide to tranform AST to XML.
> 
> Thanks to Oliver Zeigermann, there are AST xml
> serialization methods 
> built into the AST classes...search for XML in the
> api.
> 
> Ter
> 
> 
> 
> 


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Sports - Sign up for Fantasy Baseball. 
http://baseball.fantasysports.yahoo.com/


More information about the antlr-interest mailing list