parse transform

Luke Gorrie luke@REDACTED
Thu Aug 30 16:41:51 CEST 2001


Hiho,

I want to write a parse transform to munge the arguments of calls to
certain functions. To find all those functions, I'll need to recurse
down all the expressions I find and so forth.

Is the best approach to cut-and-paste all of erl_id_trans and then
insert my new clause, or is there some more elegant but similarly easy
way?

Something nice would be what's called a "visitor" in the object
oriented world: something generic that would traverse the parse tree
and call my module to see what I want to do with each node. For most
nodes I'd just say "keep the structure and recursively process the
children", but for calls I'd do something special.

Has anyone done something like that? If so, can I have a copy? :-)

-Luke




More information about the erlang-questions mailing list