[antlr-interest] 'Catching' functions --

William v Doorn williamvdoorn at gmail.com
Sat Apr 17 09:41:31 PDT 2010


Hello all,

I'm writing a simple language where functions is a feature. To do this I
need to somehow catch the tree of expressions/statements and execute it with
the parameter(s) when it's needed. However, is it possible to create those
trees when walking over the AST? Let's say I have this in the tree:

^(FUNC_DECL type ID formalParams? block)

Is it possible to get the tree of the block? I only found this possible to
do when building the AST (using $block.tree) but I can't seem to do this
when walking over the AST.

Thanks,

William van Doorn


More information about the antlr-interest mailing list