<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">There is some stuff in parse_trans to help.</div><div class=""><br class=""></div><div class="">1. parse_trans_pp.erl, which is designed to be used via escript as well</div><div class=""><a href="https://github.com/uwiger/parse_trans/blob/master/doc/parse_trans_pp.md" class="">https://github.com/uwiger/parse_trans/blob/master/doc/parse_trans_pp.md</a></div><div class=""><br class=""></div><div class="">2. parse_trans_codegen.erl, for generating ASTs.</div><div class=""><a href="https://github.com/uwiger/parse_trans/blob/master/doc/parse_trans_codegen.md" class="">https://github.com/uwiger/parse_trans/blob/master/doc/parse_trans_codegen.md</a></div><div class=""><a href="https://github.com/uwiger/parse_trans/blob/master/examples/ex_codegen.erl" class="">https://github.com/uwiger/parse_trans/blob/master/examples/ex_codegen.erl</a></div><div class=""><br class=""></div><div class="">3. Accidentally undocumented are the compile options ‘pt_pp_src’ and </div><div class="">   ‘pt_log_forms’, which instruct the parse_trans transforms to either pretty-print</div><div class="">  the resulting source, or to write the AST, into a separate file. </div><div class=""><br class=""></div><div class="">BR,</div><div class="">Ulf W</div><br class=""><div><blockquote type="cite" class=""><div class="">On 20 Mar 2015, at 09:30, Gordon Guthrie <<a href="mailto:gguthrie@basho.com" class="">gguthrie@basho.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Folks<div class=""><br class=""></div><div class="">I am generating some Erlang modules on the fly by generating ASTs.</div><div class=""><br class=""></div><div class="">For expository and code review processes I would like to be able to output the corresponding Erlang source code.</div><div class=""><br class=""></div><div class="">I have a hazy memory that this can be done, but damned if I can remember how...</div><div class=""><br class=""></div><div class="">Gordon</div></div>
_______________________________________________<br class="">erlang-questions mailing list<br class=""><a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">http://erlang.org/mailman/listinfo/erlang-questions<br class=""></div></blockquote></div><br class=""><div apple-content-edited="true" class="">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div class=""><div class="">Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.</div><div class=""><a href="http://feuerlabs.com" class="">http://feuerlabs.com</a></div></div><div class=""><br class=""></div></span><br class="Apple-interchange-newline">

</div>
<br class=""></body></html>