[antlr-interest] Filtering ASTs?

Monty Zukowski monty at codetransform.com
Fri Oct 29 10:44:06 PDT 2004


On Oct 29, 2004, at 2:13 AM, Derek wrote:

>
>
> How can I only match the entities within a VHDL file without having to
>  have my tree grammar declare all the rules from "design_file" down to
> "entity_declaration"?
>

That is actually the normal way to do it.  Have the whole tree grammar, 
then subclass and only override rules where you want to add actions.

Alternately you can search the tree and then start your parsing from 
there.  The AST classes have find* methods.  For instance see 
BaseAST.java and its findAll() method.

Monty

ANTLR & Java Consultant -- http://www.codetransform.com
ANSI C/GCC transformation toolkit -- 
http://www.codetransform.com/gcc.html
Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

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





More information about the antlr-interest mailing list