[erlang-questions] clarify: how to traverse AST with erl_syntax functions ?

Richard Carlsson <>
Mon Dec 17 12:17:18 CET 2007

Roberto Saccon wrote:
> And now how do I get to the function inside ? Is there a "direct way"
> to get there or do I need to unpack the tuple ?

You should only use the functions in the erl_syntax module to
compose/decompose abstract syntax trees; the representation is
not for human consumption (and could theoretically be changed
at any time without warning).

There are some utility functions in erl_syntax_lib which make the
decomposition easier (not the greatest set of functions i've written,
but they work). You should also look at the functions make_tree/2
and subtrees/1 in erl_syntax.


More information about the erlang-questions mailing list