Do this with source code control. I create a clean unadorned grammar (other
than if I have no choice but to have semantic action code) as the base point
for everything and always change that. Then I integrate (using perforce
terminology) to all my other specific use targets.

Generally, I do nothing in the parser but produce an AST and if feasible,
build a symbol table(s). Then I do everything using tree walking - I
recommend this approach generally and in many cases it is all you can do
because only multiple tree walks distinguish what you parsed (such as C++
for instance).

There are some applications where the info you want from the parser is
available as you go and trivial to gather, but personally I would still use
an AST walk because requirements have a habit of becoming more complicated
overtime.

Jim

> -----Original Message-----
> From: [email protected] [mailto:antlr-interest-
> [email protected]] On Behalf Of Stanley Steel
> Sent: Friday, August 13, 2010 11:54 AM
> To: [email protected]
> Subject: [antlr-interest] Code Hooks
> 
> Is there a way to specify code hooks for @init and @after.  I would like
to
> keep my spec clean and not pollute it with code specific to a particular
usage.
> Does anybody else verify scope in the tree parser instead of the regular
> parser?
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to