[antlr-interest] tree parsers vs visitors & xml translators etc...

Silvain Piree s.piree at enneya.com
Thu May 9 23:33:37 PDT 2002


> Can anybody comment on the visitor/xslt side?  
> How would you do this "find class defs" problem efficiently?

The problem with Java is that you also have anonymous
classes that can be defined within methods as part of an
expression.

So, if you really want to find ALL class definitions, then
you also have to analyze methods and expressions :-(

A good XPath implementation will support indexing
of elements, so that a query like "//class" will not need
to traverse the tree, but instead only needs to look in the
index (which is very efficient).

ANTLR tree transformation certainly can be usefull,
but the simplicity of XPath queries nested in your java
source is difficult to beat for many simple purposes.

Silvain



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list