I have Core Erlang forms constructs with the cerl
module. I wish to "decompile" it into an Erlang source code string.
I though I could do something like this:
Forms = erl_syntax:form_list(CoreForms),
erl_prettypr:format(Forms).
However erl_syntax:form_list/1
returns an empty list.
Core Erlang ASTs cannot be handled with the utilities in syntax_tools - those are for normal Erlang ASTs only. For Core Erlang there are two modules (undocumented) for prettyprinting:
core_pp
in the compiler application, similar toerl_pp
in stdlib, andcerl_prettypr
in the hipe application (under lib/hipe/cerl/) which is similar toerl_prettypr
in syntax_tools.