[antlr-interest] TreeParser question

Terence Parr parrt at cs.usfca.edu
Wed Nov 9 12:55:17 PST 2005


On Nov 9, 2005, at 12:50 PM, David Ray wrote:

> Hello,
>
> Is there a way for a tree parser rule to match against any  
> occurrence of a particular node type without encoding the entire  
> tree structure in the rule?  Or am I better off just writing a  
> recursive search in Java?

Hi. I think you want something like the following AST methods:

     public ASTEnumeration findAll(AST tree);

     public ASTEnumeration findAllPartial(AST subtree);

Ter


More information about the antlr-interest mailing list