[antlr-interest] How to match a tree without executing the actions

Mu Qiao qiaomuf at gmail.com
Sun Apr 17 07:19:48 PDT 2011


Hi,

I have an AST and a subtree that represents for function definition.
When I implement the tree walker, I don't want to executing the
actions in the function body when I match a function definition. I
know I can pass an argument down indicating whether to execute the
actions or not. Is there any way that doesn't require any modification
to other rules except the function definition rule?

I tried to skip the whole function body AST but didn't success because
it's hard for me to find the last node index of the body. If I can
have that, I guess SEEK(index + 1) could work for me if I'm right.

Could any one please give me a hand?

-- 
Best wishes,
Mu Qiao
GnuPG fingerprint: 92B1 B0C4 8D14 F8C4 EFA5  3ACC 30B3 0DE4 17B1 57E9


More information about the antlr-interest mailing list