[antlr-interest] Re: TreeParser efficiency: Can TreeParsers ignore arbitary subtrees?

lgcraymer lgc at mail1.jpl.nasa.gov
Tue May 13 11:22:12 PDT 2003


Micheal--

The trick here is that "." matches any AST and does not attempt to 
search the subtree.  So you can do something like
     (FOO) => .
to match FOO and not search the subtree under FOO.

--Loring


--- In antlr-interest at yahoogroups.com, "micheal_jor" <open.zone at v...> 
wrote:
> Hi,
> 
> I just wondered if it is possible to generate TreeParsers that 
ignore 
> (i.e. do not "visit") the nodes in arbitary subtrees. 
> 
> I have an AST in which only a few nodes have attributes I am 
> interested in processing with a TreeParser. Because every TreeParser 
> grammar describes the whole tree(?), all nodes are still visited 
even 
> if no action code exists to be executed.
> 
> Is it possible to effectively say in the TreeParser grammar "I won't 
> be doing anything in this node/subtree so don't even generate code 
to 
> visit it?
> 
> Cheers,
> 
> Micheal


 

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




More information about the antlr-interest mailing list