[erlang-questions] AST from source?

Dmytro Lytovchenko <>
Mon Apr 17 12:18:04 CEST 2017

case compile:file(Filename, [to_kernel, binary, report]) of {ok,
ModuleName, Code} ->...
change to_kernel to to_core, or to 'S' for you know what.
Binary will get you the result as a part of return value
Report will print errors

2017-04-17 10:43 GMT+02:00 Xavier Noria <>:

> Is there a one-liner to get an AST from source code?
> I have seen you can get it from the .beam file if debug_info was enabled,
> and have also seen some multiline snippet that uses erl_scan and erl_parse,
> but nothing as encapsulated as what you have for generating core or kernel.
> _______________________________________________
> erlang-questions mailing list
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170417/19e7ced7/attachment.html>

More information about the erlang-questions mailing list