[antlr-interest] More on TokenWithIndex
Monty Zukowski
monty at codetransform.com
Wed Oct 27 09:57:43 PDT 2004
On Oct 27, 2004, at 9:41 AM, Paul J. Lucas wrote:
>
>> Another approach would be to keep some sort of stack of "interesting"
>> regions.
>
> Yeah. It would be nice if ANTLR did all this sort of thing for
> you since the entire problem is of general interest. (Terrence?)
>
>
Well, doing it in actions is the ANTLR way. You do have to tell ANTLR
which regions are interesting and which aren't. If ANTLR were to
support that it would mean annotating your parser with yet another
symbol, which is actually ok with me but not with Terence. I've been
advocating for support of user specified domain specific language
notations in ANTLR itself for quite a while and Ter hasn't seen the
light yet.
In any event someone has to figure out the right way to do it first....
For this one it's almost like I would want to specify it in an aspect
oriented way like
region_rules {
statement;
expression;
declaration;
typeName;
}
And then we'd want ANTLR to add a little bit of code to rule entry &
exit to maintain that stack by pushing and popping region objects.
Then constructing tree nodes would add a reference to the current
region object.
Monty
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