On Nov 30, 2008, at 9:35 AM, Oliver Zeigermann wrote:
> I tried this out and it actually works great :)
Hooray! Should I add some rewrite examples?
> I am wondering if "bottomup" is really needed, though. I only need
> "topdown" as the whole structure already is encoded in the tree. So
> there is no need to track context for me in that way.
>
> Do you have any use case for that?
Yep, you want to pop scope as you go back up the tree. Push scope on
way down. Remember that matching a method or block pattern is just
that; don't tell it how to walk the body or whatever.
m : ^(METHOD type=. ID body=.) {push scope} ;
remember we are now just telling it what to match, no how to walk the
tree. it will walk the type and body for us. You can't put the "pop
scope" action in the same rule.
> Cheers and thanks for that cool feature :)
My pleasure.
Ter
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org:8080/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
-~----------~----~----~----~------~----~------~--~---