[antlr-interest] Serialization of ANTLR tree

Rune Glerup rug at maconomy.com
Thu Mar 18 12:53:43 PDT 2010

Hi Jim

> Are you sure that you have defined the correct requirement here? You 
> parse the source text and create tokens and the tree (which all 
> reference back in to the original source text), then you are going to 
> send a text representation of the tree over the wire and re-assemble 
> it. Just send the original source text and parse it in to the AST at 
> the receiving end.

That's a good point! :)

Actually, the source text is parsed and an AST is built.

This tree is then rewritten using a tree grammar. The tree grammar
resolves some kinds identifiers to values from the environment, while
leaving other kinds of identifiers unresolved for later processing.

The rewritten tree is then passed through RMI for further processing in
another environment.

The early identifier resolution needs to take place before transmitting
the tree over RMI, because that information is not readily available on
the other side.

So the tree I want to transmit is not necessarily the AST resulting from
just parsing the original source text.

Rune Glerup

More information about the antlr-interest mailing list