[antlr-interest] Serializing the ANTRL AST

Kieran Simpson kierans777 at gmail.com
Sat Aug 4 04:03:02 PDT 2012


If you're using the Java target, then you have Java objects at the end 
of the parse.  You can serialise the objects to a binary file (ie: a bit 
blob), then when needing to read them back in.

However I'd only do that if the source of the parse is unlikely to 
change very often or if deserialising the bit blob is actually faster 
than reparsing your source.

HTH.

Cheers,

On 3/08/12 5:01 AM, vybs wrote:
> I need a way to serialize the AST /CommonTreeNodeStream generated by Antlr
> and then store it, so that I don't parse every time I walk the tree
>
> Is this even possible in ANTLR3? I am a newbie and any pointers in this
> direction will help. ( I did google for prev posts and stackoverflow, but I
> could not derive anything conclusive)
>
> thanks in advance


More information about the antlr-interest mailing list