[antlr-interest] On trees and JavaBeans, part 2: tree creation

Tiller, Michael (M.M.) mtiller at ford.com
Mon Apr 25 12:42:42 PDT 2005


Scott,

  Sorry for the late comment on this but I was behind in reading the
mailing list traffic.

  You've done a good job of articulating something that has been bother
me for a while about ANTLR's AST approach but I just couldn't put my
finger on it.  In addition to JXPath, You might also want to look at
Jaxen.  I've used it for a couple of things that sound very similar to
what you are after.

  Keep in mind that using a tool like JAXEN or JXPath isn't specifically
about being able to support XPath or being able to create an XML
representation from any data structure (although both of them are nice
consequences).  It is about mapping to a standard data model.  As you
say, then you can write a tree parser to walk the tree and the input can
be anything (XML, my heterogenous tree structure, Java objects,
whatever).  To me this sounds like a really good approach (and something
I'd probably be doing anyway for other tools that use adaptors).

--
Mike

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Scott Stanchfield
> Sent: Monday, April 18, 2005 11:33 PM
> To: 'Martin Probst'; antlr-interest at antlr.org
> Subject: RE: [antlr-interest] On trees and JavaBeans, part 2: tree
> creation
> 
> That looks cool -- I'll have to look harder at it!
> 
> Though I'd really like to be able to specify matches and actions to
take
> on
> the matches (I prefer declarative programming when possible...)
> 
> -- Scott
> 
> > -----Original Message-----
> > From: Martin Probst [mailto:mail at martin-probst.com]
> > Sent: Monday, April 18, 2005 10:54 AM
> > To: 'Scott Stanchfield'; antlr-interest at antlr.org
> > Subject: RE: [antlr-interest] On trees and JavaBeans, part 2:
> > tree creation
> > [...]
> > Did you take a look at Apache JXPath? It uses an XPathy
> > language to query object graphs. Afaik it does this by using
> > reflection, but this is of course not necessary in ANTLR.
> 
> 
> 



More information about the antlr-interest mailing list