Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

erl_pp(3erl) [linux man page]

erl_pp(3erl)						     Erlang Module Definition						      erl_pp(3erl)

NAME
erl_pp - The Erlang Pretty Printer DESCRIPTION
The functions in this module are used to generate aesthetically attractive representations of abstract forms, which are suitable for print- ing. 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. EXPORTS
form(Form) -> DeepCharList form(Form, HookFunction) -> DeepCharList Types Form = term() HookFunction = see separate description below. DeepCharList = [char()|DeepCharList] Pretty prints a Form which is an abstract form of a type which is returned by erl_parse:parse_form . attribute(Attribute) -> DeepCharList attribute(Attribute, HookFunction) -> DeepCharList Types Attribute = term() HookFunction = see separate description below. DeepCharList = [char()|DeepCharList] The same as form , but only for the attribute Attribute . function(Function) -> DeepCharList function(Function, HookFunction) -> DeepCharList Types Function = term() HookFunction = see separate description below. DeepCharList = [char()|DeepCharList] The same as form , but only for the function Function . guard(Guard) -> DeepCharList guard(Guard, HookFunction) -> DeepCharList Types Form = term() HookFunction = see separate description below. DeepCharList = [char()|DeepCharList] The same as form , but only for the guard test Guard . exprs(Expressions) -> DeepCharList exprs(Expressions, HookFunction) -> DeepCharList exprs(Expressions, Indent, HookFunction) -> DeepCharList Types Expressions = term() HookFunction = see separate description below. Indent = integer() DeepCharList = [char()|DeepCharList] The same as form , but only for the sequence of expressions in Expressions . expr(Expression) -> DeepCharList expr(Expression, HookFunction) -> DeepCharList expr(Expression, Indent, HookFunction) -> DeepCharList expr(Expression, Indent, Precedence, HookFunction) ->-> DeepCharList Types Expression = term() HookFunction = see separate description below. Indent = integer() Precedence = DeepCharList = [char()|DeepCharList] This function prints one expression. It is useful for implementing hooks (see below). UNKNOWN EXPRESSION HOOKS
The optional argument HookFunction , shown in the functions described above, defines a function which is called when an unknown form occurs where there should be a valid expression. It can have the following formats: Function : The hook function is called by: Function(Expr, CurrentIndentation, CurrentPrecedence, HookFunction) none : There is no hook function The called hook function should return a (possibly deep) list of characters. expr/4 is useful in a hook. If CurrentIndentation is negative, there will be no line breaks and only a space is used as a separator. BUGS
It should be possible to have hook functions for unknown forms at places other than expressions. SEE ALSO
io(3erl) , erl_parse(3erl) , erl_eval(3erl) Ericsson AB stdlib 1.17.3 erl_pp(3erl)

Check Out this Related Man Page

epp(3erl)						     Erlang Module Definition							 epp(3erl)

NAME
epp - An Erlang Code Preprocessor DESCRIPTION
The Erlang code preprocessor includes functions which are used by compile to preprocess macros and include files before the actual parsing takes place. EXPORTS
open(FileName, IncludePath) -> {ok,Epp} | {error, ErrorDescriptor} open(FileName, IncludePath, PredefMacros) -> {ok,Epp} | {error, ErrorDescriptor} Types FileName = atom() | string() IncludePath = [DirectoryName] DirectoryName = atom() | string() PredefMacros = [{atom(),term()}] Epp = pid() -- handle to the epp server ErrorDescriptor = term() Opens a file for preprocessing. close(Epp) -> ok Types Epp = pid() -- handle to the epp server Closes the preprocessing of a file. parse_erl_form(Epp) -> {ok, AbsForm} | {eof, Line} | {error, ErrorInfo} Types Epp = pid() AbsForm = term() Line = integer() ErrorInfo = see separate description below. Returns the next Erlang form from the opened Erlang source file. The tuple {eof, Line} is returned at end-of-file. The first form corresponds to an implicit attribute -file(File,1). , where File is the name of the file. parse_file(FileName,IncludePath,PredefMacro) -> {ok,[Form]} | {error,OpenError} Types FileName = atom() | string() IncludePath = [DirectoryName] DirectoryName = atom() | string() PredefMacros = [{atom(),term()}] Form = term() -- same as returned by erl_parse:parse_form Preprocesses and parses an Erlang source file. Note that the tuple {eof, Line} returned at end-of-file is included as a "form". ERROR INFORMATION
The ErrorInfo mentioned above is the standard ErrorInfo structure which is returned from all IO modules. It has the following format: {ErrorLine, Module, ErrorDescriptor} A string which describes the error is obtained with the following call: Module:format_error(ErrorDescriptor) SEE ALSO
erl_parse(3erl) Ericsson AB stdlib 1.17.3 epp(3erl)
Man Page