[antlr-interest] save a tree

Andy Tripp antlr at jazillian.com
Mon Jan 14 14:42:21 PST 2008


There's gotta be a tool that lets you save a Java object in XML and then 
read
it back in in python. There are lots of tools that save Java objects as XML.
Maybe this thing works: 
http://www.ibm.com/developerworks/library/x-matters32.html

Andy

Benjamin Niemann wrote:
> Hi Mathew,
>
> Mathew Yeates wrote:
>   
>>  From within a java program I want to save (to disk) the AST I've
>> created. Then I want to read it back into a python program. Anyone have
>> any ideas about the simplest approach to this?
>>     
>
> I'm not aware of any format, package, whatever (something that could
> (de)serialize custom objects cross language) that could help you here - and
> ANTLR does not offer anything here. So you probably have to build your own
> serialization in Java and deserialize in Python - and ANTLR does not offer
> anything here.
> Just walk to AST and dump all info that you need in a easy to parse format
> and read it back in Python building the nodes along the way.
>
> -Ben
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080114/dbbadab4/attachment.html 


More information about the antlr-interest mailing list