Module ec_compile

These are various utility functions to help with compiling and decompiling erlang source.

Copyright © (C) 2011, Erlware, LLC.

Authors: Eric Merritt.

Description

These are various utility functions to help with compiling and decompiling erlang source. They are mostly useful to the language/parse transform implementor.

Function Index

beam_to_erl_source/2decompile a beam file that has been compiled with +debug_info into a erlang source file.
erl_source_to_asm/1compile an erlang source file into erlang terms that represent the relevant ASM.
erl_source_to_core_ast/1compile an erlang source file into a Core Erlang AST.
erl_source_to_erl_ast/1compile an erlang source file into an Erlang AST.
erl_source_to_erl_syntax/1compile an erlang source file to a string that displays the 'erl_syntax1 calls needed to reproduce those terms.
erl_string_to_asm/1compile a string representing an erlang expression into a term that represents the ASM.
erl_string_to_core_ast/1compile a string representing an erlang expression into a Core Erlang AST.
erl_string_to_erl_ast/1compile a string representing an erlang expression into an Erlang AST.
erl_string_to_erl_syntax/1compile an erlang source file to a string that displays the 'erl_syntax1 calls needed to reproduce those terms.

Function Details

beam_to_erl_source/2

beam_to_erl_source(BeamFName::string(), ErlFName::string()) -> ok | term()

BeamFName: the name of the beamfile
ErlFName: the name of the erlang file where the generated source file will be output. This should *not* be the same as the source file that created the beamfile unless you want to overwrite it.

decompile a beam file that has been compiled with +debug_info into a erlang source file

erl_source_to_asm/1

erl_source_to_asm(Path::file:filename()) -> ErlangAsm::term()

Path: - The path to the erlang source file

compile an erlang source file into erlang terms that represent the relevant ASM

erl_source_to_core_ast/1

erl_source_to_core_ast(Path::file:filename()) -> CoreAst::term()

Path: - The path to the erlang source file

compile an erlang source file into a Core Erlang AST

erl_source_to_erl_ast/1

erl_source_to_erl_ast(Path::file:filename()) -> ErlangAst::term()

Path: - The path to the erlang source file

compile an erlang source file into an Erlang AST

erl_source_to_erl_syntax/1

erl_source_to_erl_syntax(Path::file:filename()) -> string()

Path: - The path to the erlang source file

compile an erlang source file to a string that displays the 'erl_syntax1 calls needed to reproduce those terms.

erl_string_to_asm/1

erl_string_to_asm(StringExpr::string()) -> ErlangAsm::term()

StringExpr: - The path to the erlang source file

compile a string representing an erlang expression into a term that represents the ASM

erl_string_to_core_ast/1

erl_string_to_core_ast(StringExpr::string()) -> CoreAst::term()

StringExpr: - The path to the erlang source file

compile a string representing an erlang expression into a Core Erlang AST

erl_string_to_erl_ast/1

erl_string_to_erl_ast(StringExpr::string()) -> ErlangAst::term()

StringExpr: - The path to the erlang source file

compile a string representing an erlang expression into an Erlang AST

erl_string_to_erl_syntax/1

erl_string_to_erl_syntax(BinaryExpr::string() | binary()) -> string()

compile an erlang source file to a string that displays the 'erl_syntax1 calls needed to reproduce those terms.


Generated by EDoc, Feb 15 2022, 15:17:48.