The functions in this module are used to generate aesthetically attractive representations of abstract forms, which are suitable for printing. All functions return (possibly deep) lists of characters and generate an error if the form is wrong.
All functions can have an optional argument, which specifies a hook that is called if an attempt is made to print an unknown form.
Note that if the functions in this module are used to convert
abstract code back to Erlang source code, the enclosing function
should first be processed by
Optional argument
The called hook function is to return a (possibly deep) list of
characters. Function
If
The option
The option
The option
Same as
Prints one expression. It is useful for implementing hooks (see
section
Same as
Pretty prints a
Same as
Same as
The Erlang compiler will, when expanding records to tuples, introduce new variables in the abstract representation. As the expansion is done on the abstract representation, the compiler can safely name the new variables with names that are not syntactically valid in Erlang source code (the name starts with a lowercase letter), thus ensuring the uniqueness of the new names.
The above strategy leads to problems if a user wants to
convert the abstract representation, using the functions of
this module back to Erlang source code. Typically, pattern
variables are output as atoms thus changing the sematics of
the program. To solve this problem
It is not possible to have hook functions for unknown forms at other places than expressions.