[erlang-questions] How to parse whole module?

Daniel Kwiecinski daniel.kwiecinski@REDACTED
Wed Jul 16 22:50:42 CEST 2008


Hi folks,

   How can I obtain the abstract form of the whole module source code?
Using something like this:

eval(SourceCode,Environ) ->
    {ok,Scanned,_} = erl_scan:string(SourceCode),
    {ok,Parsed} = erl_parse:parse_exprs(Scanned),
    erl_eval:exprs(Parsed,Environ).


works only for single forms not for a whole module. Ideally what I need is
kind of compiler switch (similar to -S) resulting in emitting AST and AST
after applied any parse_transforms.
Thank you in advance.

-- 
Kind Regards,
Daniel Kwiecinski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080716/5b7ab2cd/attachment.htm>


More information about the erlang-questions mailing list