[antlr-interest] Serializing a CommonTree

Петров Илья petrov.ilya at gmail.com
Sat Jun 4 08:39:19 PDT 2011


> Doesn't look they implement Serializable.

CommonTree doesn't know anything about it's tokens,
it may hold tokens which are not Serializable.
I don't know where can someone ever want to have
such tokens, but maybe there is such a case. Supply
one if you can.

> I need to create this
> capability; when it's working, I'll submit it to the team.

You have to create CommonTree which restricts the type
of the token it holds, something like SerializableCommonTree.
There is CommonToken which is already Serializable and
could be used as a restriction on `Token token` attribute of
the CommonTree class.

To this letter I've attached an implementation that I've tried
to make and which doesn't work due to the problem described
in the second question here:
[ http://www.antlr.org/pipermail/antlr-interest/2006-July/016831.html ].
Feel free to make use of it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ast_serialization.7z
Type: application/octet-stream
Size: 3914 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20110604/959a6fe0/attachment.obj 


More information about the antlr-interest mailing list