[antlr-interest] RE: On trees and JavaBeans

M C mortench2004 at yahoo.dk
Mon Apr 18 14:19:55 PDT 2005


I really like Scott Stanchfields idea for a "tree
parser that could walk **any** data structure*". That
would very cool. I fact I could see how it could make
a serious impact on how people would do OO.

The current design where every node must implement a
complicated interface really hinders the use of the
tree paser.

Recently I had a interesting case where I needed to do
fast mathematical reductions on heterogeneous query
expression trees based on an immutable composite
pattern. Since all expression nodes were immutable
(only way to "change" an expresion was to create a new
one) there was NO way the expression classes could
(directly) implement the antlr interface even if I
wanted to (also the overhead and uglyness of the
solution was a prohibiting factor).

At the time I thought about using a tree parser for
the matematical reductions but discarded it as too
wishfull thinking. With Scott's proposal that would
not only be possible but probably also THE very best
way of doing such things (like doing reductions by
expression tree rewriting).

Great idea!

Cheers,
Morten Christensen




More information about the antlr-interest mailing list