Generic parse transform library for Erlang.
Authors: : Ulf Wiger ([email protected]
).
This module contains some useful utility functions for inspecting
the results of parse transforms or code generation.
The function main/1
is called from escript, and can be used to
pretty-print debug info in a .beam file from a Linux shell.
Using e.g. the following bash alias:
alias pp='escript $PARSE_TRANS_ROOT/ebin/parse_trans_pp.beam'
a file could be pretty-printed using the following command:
main/1 | |
pp_beam/1 | Reads debug_info from the beam file Beam and returns a string containing the pretty-printed corresponding erlang source code. |
pp_beam/2 | Reads debug_info from the beam file Beam and pretty-prints it as Erlang source code, storing it in the file Out. |
pp_src/2 | Pretty-prints the erlang source code corresponding to Forms into Out. |
main(X1::[string()]) -> any()
pp_beam(Beam::file:filename()) -> ok | {error, any()}
Reads debug_info from the beam file Beam and returns a string containing the pretty-printed corresponding erlang source code.
pp_beam(F::file:filename(), Out::file:filename()) -> ok | {error, any()}
Reads debug_info from the beam file Beam and pretty-prints it as Erlang source code, storing it in the file Out.
pp_src(Forms0::parse_trans:forms(), F::file:filename()) -> ok
Pretty-prints the erlang source code corresponding to Forms into Out