ErlangFrontend.ErlangAst
Erlang abstract forms, following https://erlang.org/doc/apps/erts/absform.html
val sexp_of_module_reference : module_reference -> Sexplib0.Sexp.t
val sexp_of_function_reference : function_reference -> Sexplib0.Sexp.t
val sexp_of_function_ : function_ -> Sexplib0.Sexp.t
val sexp_of_location : location -> Sexplib0.Sexp.t
val sexp_of_record_name : record_name -> Sexplib0.Sexp.t
val sexp_of_binary_operator : binary_operator -> Sexplib0.Sexp.t
val sexp_of_unary_operator : unary_operator -> Sexplib0.Sexp.t
val sexp_of_association_kind : association_kind -> Sexplib0.Sexp.t
val sexp_of_exception_ : exception_ -> Sexplib0.Sexp.t
val sexp_of_type_specifier : type_specifier -> Sexplib0.Sexp.t
val sexp_of_literal : literal -> Sexplib0.Sexp.t
val sexp_of_scope : scope -> Sexplib0.Sexp.t
type body = expression list
and simple_expression =
| BinaryOperator of expression * binary_operator * expression
| BitstringComprehension of {
expression : expression;
qualifiers : qualifier list;
}
| BitstringConstructor of bin_element list
| Block of body
| Call of {
module_ : expression option;
function_ : expression;
args : expression list;
}
| Case of {
expression : expression;
cases : case_clause list;
}
| Catch of expression
| Cons of {
head : expression;
tail : expression;
}
| Fun of function_
| If of case_clause list
| Lambda of {
name : string option;
cases : case_clause list;
mutable procname : IR.Procname.t option;
mutable captured : IR.Pvar.Set.t option;
}
| ListComprehension of {
expression : expression;
qualifiers : qualifier list;
}
| Literal of literal
| Map of {
map : expression option;
updates : association list;
}
| MapComprehension of {
expression : association;
qualifiers : qualifier list;
}
| Match of {
pattern : expression;
body : expression;
}
| Maybe of {
body : body;
else_cases : case_clause list;
}
| MaybeMatch of {
pattern : expression;
body : expression;
}
| Nil
| Receive of {
cases : case_clause list;
timeout : timeout option;
}
| RecordAccess of {
record : expression;
name : record_name;
field : string;
}
| RecordIndex of {
name : record_name;
field : string;
}
| RecordUpdate of {
record : expression option;
name : record_name;
updates : record_update list;
}
| TryCatch of {
body : body;
ok_cases : case_clause list;
catch_cases : catch_clause list;
after : body;
}
| Tuple of expression list
| UnaryOperator of unary_operator * expression
| Variable of {
vname : string;
mutable scope : scope option;
}
and qualifier =
| BitsGenerator of {
pattern : expression;
expression : expression;
}
| Filter of expression
| Generator of {
pattern : expression;
expression : expression;
}
| MapGenerator of {
pattern : association;
expression : expression;
}
and bin_element = {
expression : expression;
size : expression option;
types : type_specifier list option;
}
and 'pat clause = {
location : location;
patterns : 'pat list;
guards : expression list list;
body : body;
}
and case_clause = expression clause
and catch_clause = catch_pattern clause
val sexp_of_body : body -> Sexplib0.Sexp.t
val sexp_of_simple_expression : simple_expression -> Sexplib0.Sexp.t
val sexp_of_expression : expression -> Sexplib0.Sexp.t
val sexp_of_qualifier : qualifier -> Sexplib0.Sexp.t
val sexp_of_timeout : timeout -> Sexplib0.Sexp.t
val sexp_of_bin_element : bin_element -> Sexplib0.Sexp.t
val sexp_of_record_update : record_update -> Sexplib0.Sexp.t
val sexp_of_association : association -> Sexplib0.Sexp.t
val sexp_of_clause :
'pat. ('pat -> Sexplib0.Sexp.t) ->
'pat clause ->
Sexplib0.Sexp.t
val sexp_of_case_clause : case_clause -> Sexplib0.Sexp.t
val sexp_of_catch_clause : catch_clause -> Sexplib0.Sexp.t
val sexp_of_catch_pattern : catch_pattern -> Sexplib0.Sexp.t
See also https://www.erlang.org/doc/reference_manual/typespec.html
val sexp_of_atom_type : atom_type -> Sexplib0.Sexp.t
val sexp_of_integer_type : integer_type -> Sexplib0.Sexp.t
type type_ =
| Any
| Atom of atom_type
| BitString of {
}
| Integer of integer_type
| List of list_type
| Map
| Nil
| None
| Pid
| Port
| Record of string
| Reference
| Remote of {
}
| Tuple of tuple_type
| Union of type_ list
| UserDefined of string
| Var of string
| Unsupported
val sexp_of_type_ : type_ -> Sexplib0.Sexp.t
val sexp_of_list_type : list_type -> Sexplib0.Sexp.t
val sexp_of_tuple_type : tuple_type -> Sexplib0.Sexp.t
val sexp_of_spec_disjunct : spec_disjunct -> Sexplib0.Sexp.t
type spec = spec_disjunct list
val sexp_of_spec : spec -> Sexplib0.Sexp.t
val sexp_of_record_field : record_field -> Sexplib0.Sexp.t
val sexp_of_attribute_record : attribute_record -> Sexplib0.Sexp.t
val sexp_of_attribute : attribute -> Sexplib0.Sexp.t
type simple_form =
| Export of function_ list
| Import of {
module_name : string;
functions : function_ list;
}
| Module of string
| Attribute of attribute
| File of {
}
| Function of {
function_ : function_;
clauses : case_clause list;
}
| Record of {
name : string;
fields : record_field list;
}
| Spec of {
}
| Type of {
name : string;
type_ : type_;
}
val sexp_of_simple_form : simple_form -> Sexplib0.Sexp.t
val sexp_of_form : form -> Sexplib0.Sexp.t
type module_ = form list
val sexp_of_module_ : module_ -> Sexplib0.Sexp.t