[erlang-questions] How to parse whole module?

Joe Armstrong erlang@REDACTED
Thu Jul 17 09:21:05 CEST 2008


epp:parse_file("foo.erl", "", "").

/Joe


2008/7/16 Daniel Kwiecinski <daniel.kwiecinski@REDACTED>:
> 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
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



-- 
fra@REDACTED; ingvar.akesson@REDACTED

[Kopia av detta meddelande skickas till FRA för övervakningsändamål.
De vill ju ändå läsa min e-post.]

[A copy of this mail has been sent to
FRA for monitoring purposes. FRA wants to read all my e-mail and have
been allowed to do by the Swedish parliment - in violation of article
12 of the UN Universal Declaration of Human Rights]



More information about the erlang-questions mailing list