/lib/syntax_tools/doc/erl_syntax.html
HTML | 2608 lines | 2317 code | 291 blank | 0 comment | 0 complexity | c88080a99e6714ed35d735276bae267c MD5 | raw file
Possible License(s): LGPL-2.1, BSD-3-Clause, AGPL-1.0
Large files files are truncated, but you can click here to view the full file
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <title>Module erl_syntax</title>
- <link rel="stylesheet" type="text/css" href="stylesheet.css">
- </head>
- <body bgcolor="white">
- <h1>Module erl_syntax</h1>
- Abstract Erlang syntax trees.<ul><li><a href="#description">Description</a></li><li><a href="#types">Data Types</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul><h2><a name="description">Description</a></h2>Abstract Erlang syntax trees.
-
- <p> This module defines an abstract data type for representing Erlang
- source code as syntax trees, in a way that is backwards compatible
- with the data structures created by the Erlang standard library
- parser module <code>erl_parse</code> (often referred to as "parse
- trees", which is a bit of a misnomer). This means that all
- <code>erl_parse</code> trees are valid abstract syntax trees, but the
- reverse is not true: abstract syntax trees can in general not be used
- as input to functions expecting an <code>erl_parse</code> tree.
- However, as long as an abstract syntax tree represents a correct
- Erlang program, the function <a href="#revert-1"><code>revert/1</code></a> should be able to
- transform it to the corresponding <code>erl_parse</code>
- representation.</p>
-
- <p>A recommended starting point for the first-time user is the
- documentation of the <a href="#type-syntaxTree"><code>syntaxTree()</code></a> data type, and
- the function <a href="#type-1"><code>type/1</code></a>.</p>
-
- <h3><b>NOTES:</b></h3>
-
- <p>This module deals with the composition and decomposition of
- <em>syntactic</em> entities (as opposed to semantic ones); its
- purpose is to hide all direct references to the data structures used
- to represent these entities. With few exceptions, the functions in
- this module perform no semantic interpretation of their inputs, and
- in general, the user is assumed to pass type-correct arguments - if
- this is not done, the effects are not defined.</p>
-
- <p>With the exception of the <code>erl_parse</code> data structures,
- the internal representations of abstract syntax trees are subject to
- change without notice, and should not be documented outside this
- module. Furthermore, we do not give any guarantees on how an abstract
- syntax tree may or may not be represented, <em>with the following
- exceptions</em>: no syntax tree is represented by a single atom, such
- as <code>none</code>, by a list constructor <code>[X | Y]</code>, or
- by the empty list <code>[]</code>. This can be relied on when writing
- functions that operate on syntax trees.</p>
-
- <h2><a name="types">Data Types</a></h2>
- <h3><a name="type-erl_parse">erl_parse()</a></h3>
- <p><tt>erl_parse() = <a href="/usr/local/home/richardc/hipe/otp/lib/stdlib/doc/erl_parse.html#type-parse_tree">erl_parse:parse_tree()</a></tt></p>
- <p>The "parse tree"
- representation built by the Erlang standard library parser
- <code>erl_parse</code>. This is a subset of the
- <a href="#type-syntaxTree"><code>syntaxTree</code></a> type.
- </p>
- <h3><a name="type-syntaxTree">syntaxTree()</a></h3>
- <p><b>abstract datatype</b>: <tt>syntaxTree()</tt></p>
- <p>An abstract syntax tree. The
- <code>erl_parse</code> "parse tree" representation is a subset of the
- <code>syntaxTree()</code> representation.
-
- <p>Every abstract syntax tree node has a <em>type</em>, given by the
- function <a href="#type-1"><code>type/1</code></a>. Each node also
- has associated <em>attributes</em>; see <a href="#get_attrs-1"><code>get_attrs/1</code></a> for details. The
- functions <a href="#make_tree-2"><code>make_tree/2</code></a> and <a href="#subtrees-1"><code>subtrees/1</code></a> are generic
- constructor/decomposition functions for abstract syntax trees. The
- functions <a href="#abstract-1"><code>abstract/1</code></a> and <a href="#concrete-1"><code>concrete/1</code></a> convert between
- constant Erlang terms and their syntactic representations. The set of
- syntax tree nodes is extensible through the <a href="#tree-2"><code>tree/2</code></a> function.</p>
-
- <p>A syntax tree can be transformed to the <code>erl_parse</code>
- representation with the <a href="#revert-1"><code>revert/1</code></a>
- function.</p>
- </p>
- <h3><a name="type-syntaxTreeAttributes">syntaxTreeAttributes()</a></h3>
- <p><b>abstract datatype</b>: <tt>syntaxTreeAttributes()</tt></p>
- <p>This is an abstract representation of
- syntax tree node attributes; see the function <a href="#get_attrs-1"><code>get_attrs/1</code></a>.
- </p>
- <h2><a name="index">Function Index</a></h2>
- <table width="100%" border="1"><tr><td valign="top"><a href="#abstract-1">abstract/1</a></td><td>Returns the syntax tree corresponding to an Erlang term.</td></tr>
- <tr><td valign="top"><a href="#add_ann-2">add_ann/2</a></td><td>Appends the term <code>Annotation</code> to the list of user
- annotations of <code>Node</code>.</td></tr>
- <tr><td valign="top"><a href="#add_postcomments-2">add_postcomments/2</a></td><td>Appends <code>Comments</code> to the post-comments of
- <code>Node</code>.</td></tr>
- <tr><td valign="top"><a href="#add_precomments-2">add_precomments/2</a></td><td>Appends <code>Comments</code> to the pre-comments of
- <code>Node</code>.</td></tr>
- <tr><td valign="top"><a href="#application-2">application/2</a></td><td>Creates an abstract function application expression.</td></tr>
- <tr><td valign="top"><a href="#application-3">application/3</a></td><td>Creates an abstract function application expression.</td></tr>
- <tr><td valign="top"><a href="#application_arguments-1">application_arguments/1</a></td><td>Returns the list of argument subtrees of an
- <code>application</code> node.</td></tr>
- <tr><td valign="top"><a href="#application_operator-1">application_operator/1</a></td><td>Returns the operator subtree of an <code>application</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#arity_qualifier-2">arity_qualifier/2</a></td><td>Creates an abstract arity qualifier.</td></tr>
- <tr><td valign="top"><a href="#arity_qualifier_argument-1">arity_qualifier_argument/1</a></td><td>Returns the argument (the arity) subtree of an
- <code>arity_qualifier</code> node.</td></tr>
- <tr><td valign="top"><a href="#arity_qualifier_body-1">arity_qualifier_body/1</a></td><td>Returns the body subtree of an <code>arity_qualifier</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#atom-1">atom/1</a></td><td>Creates an abstract atom literal.</td></tr>
- <tr><td valign="top"><a href="#atom_literal-1">atom_literal/1</a></td><td>Returns the literal string represented by an <code>atom</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#atom_name-1">atom_name/1</a></td><td>Returns the printname of an <code>atom</code> node.</td></tr>
- <tr><td valign="top"><a href="#atom_value-1">atom_value/1</a></td><td>Returns the value represented by an <code>atom</code> node.</td></tr>
- <tr><td valign="top"><a href="#attribute-1">attribute/1</a></td><td><p>Equivalent to <a href="#attribute-2"><tt>attribute(Name, none)</tt></a>.</p>
- </td></tr>
- <tr><td valign="top"><a href="#attribute-2">attribute/2</a></td><td>Creates an abstract program attribute.</td></tr>
- <tr><td valign="top"><a href="#attribute_arguments-1">attribute_arguments/1</a></td><td>Returns the list of argument subtrees of an
- <code>attribute</code> node, if any.</td></tr>
- <tr><td valign="top"><a href="#attribute_name-1">attribute_name/1</a></td><td>Returns the name subtree of an <code>attribute</code> node.</td></tr>
- <tr><td valign="top"><a href="#binary-1">binary/1</a></td><td>Creates an abstract binary-object template.</td></tr>
- <tr><td valign="top"><a href="#binary_field-1">binary_field/1</a></td><td><p>Equivalent to <a href="#binary_field-2"><tt>binary_field(Body, [])</tt></a>.</p>
- </td></tr>
- <tr><td valign="top"><a href="#binary_field-2">binary_field/2</a></td><td>Creates an abstract binary template field.</td></tr>
- <tr><td valign="top"><a href="#binary_field-3">binary_field/3</a></td><td>Creates an abstract binary template field.</td></tr>
- <tr><td valign="top"><a href="#binary_field_body-1">binary_field_body/1</a></td><td>Returns the body subtree of a <code>binary_field</code>.</td></tr>
- <tr><td valign="top"><a href="#binary_field_size-1">binary_field_size/1</a></td><td>Returns the size specifier subtree of a
- <code>binary_field</code> node, if any.</td></tr>
- <tr><td valign="top"><a href="#binary_field_types-1">binary_field_types/1</a></td><td>Returns the list of type-specifier subtrees of a
- <code>binary_field</code> node.</td></tr>
- <tr><td valign="top"><a href="#binary_fields-1">binary_fields/1</a></td><td>Returns the list of field subtrees of a <code>binary</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#block_expr-1">block_expr/1</a></td><td>Creates an abstract block expression.</td></tr>
- <tr><td valign="top"><a href="#block_expr_body-1">block_expr_body/1</a></td><td>Returns the list of body subtrees of a <code>block_expr</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#case_expr-2">case_expr/2</a></td><td>Creates an abstract case-expression.</td></tr>
- <tr><td valign="top"><a href="#case_expr_argument-1">case_expr_argument/1</a></td><td>Returns the argument subtree of a <code>case_expr</code> node.</td></tr>
- <tr><td valign="top"><a href="#case_expr_clauses-1">case_expr_clauses/1</a></td><td>Returns the list of clause subtrees of a <code>case_expr</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#catch_expr-1">catch_expr/1</a></td><td>Creates an abstract catch-expression.</td></tr>
- <tr><td valign="top"><a href="#catch_expr_body-1">catch_expr_body/1</a></td><td>Returns the body subtree of a <code>catch_expr</code> node.</td></tr>
- <tr><td valign="top"><a href="#char-1">char/1</a></td><td>Creates an abstract character literal.</td></tr>
- <tr><td valign="top"><a href="#char_literal-1">char_literal/1</a></td><td>Returns the literal string represented by a <code>char</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#char_value-1">char_value/1</a></td><td>Returns the value represented by a <code>char</code> node.</td></tr>
- <tr><td valign="top"><a href="#class_qualifier-2">class_qualifier/2</a></td><td>Creates an abstract class qualifier.</td></tr>
- <tr><td valign="top"><a href="#class_qualifier_argument-1">class_qualifier_argument/1</a></td><td>Returns the argument (the class) subtree of a
- <code>class_qualifier</code> node.</td></tr>
- <tr><td valign="top"><a href="#class_qualifier_body-1">class_qualifier_body/1</a></td><td>Returns the body subtree of a <code>class_qualifier</code> node.</td></tr>
- <tr><td valign="top"><a href="#clause-2">clause/2</a></td><td><p>Equivalent to <a href="#clause-3"><tt>clause([], Guard, Body)</tt></a>.</p>
- </td></tr>
- <tr><td valign="top"><a href="#clause-3">clause/3</a></td><td>Creates an abstract clause.</td></tr>
- <tr><td valign="top"><a href="#clause_body-1">clause_body/1</a></td><td>Return the list of body subtrees of a <code>clause</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#clause_guard-1">clause_guard/1</a></td><td>Returns the guard subtree of a <code>clause</code> node, if
- any.</td></tr>
- <tr><td valign="top"><a href="#clause_patterns-1">clause_patterns/1</a></td><td>Returns the list of pattern subtrees of a <code>clause</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#comment-1">comment/1</a></td><td><p>Equivalent to <a href="#comment-2"><tt>comment(none, Strings)</tt></a>.</p>
- </td></tr>
- <tr><td valign="top"><a href="#comment-2">comment/2</a></td><td>Creates an abstract comment with the given padding and text.</td></tr>
- <tr><td valign="top"><a href="#comment_padding-1">comment_padding/1</a></td><td>Returns the amount of padding before the comment, or
- <code>none</code>.</td></tr>
- <tr><td valign="top"><a href="#comment_text-1">comment_text/1</a></td><td>Returns the lines of text of the abstract comment.</td></tr>
- <tr><td valign="top"><a href="#compact_list-1">compact_list/1</a></td><td>Yields the most compact form for an abstract list skeleton.</td></tr>
- <tr><td valign="top"><a href="#concrete-1">concrete/1</a></td><td>Returns the Erlang term represented by a syntax tree.</td></tr>
- <tr><td valign="top"><a href="#cond_expr-1">cond_expr/1</a></td><td>Creates an abstract cond-expression.</td></tr>
- <tr><td valign="top"><a href="#cond_expr_clauses-1">cond_expr_clauses/1</a></td><td>Returns the list of clause subtrees of a <code>cond_expr</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#conjunction-1">conjunction/1</a></td><td>Creates an abstract conjunction.</td></tr>
- <tr><td valign="top"><a href="#conjunction_body-1">conjunction_body/1</a></td><td>Returns the list of body subtrees of a
- <code>conjunction</code> node.</td></tr>
- <tr><td valign="top"><a href="#cons-2">cons/2</a></td><td>"Optimising" list skeleton cons operation.</td></tr>
- <tr><td valign="top"><a href="#copy_ann-2">copy_ann/2</a></td><td>Copies the list of user annotations from <code>Source</code> to
- <code>Target</code>.</td></tr>
- <tr><td valign="top"><a href="#copy_attrs-2">copy_attrs/2</a></td><td>Copies the attributes from <code>Source</code> to
- <code>Target</code>.</td></tr>
- <tr><td valign="top"><a href="#copy_comments-2">copy_comments/2</a></td><td>Copies the pre- and postcomments from <code>Source</code> to
- <code>Target</code>.</td></tr>
- <tr><td valign="top"><a href="#copy_pos-2">copy_pos/2</a></td><td>Copies the position information from <code>Source</code> to
- <code>Target</code>.</td></tr>
- <tr><td valign="top"><a href="#data-1">data/1</a></td><td><em>For special purposes only</em>.</td></tr>
- <tr><td valign="top"><a href="#disjunction-1">disjunction/1</a></td><td>Creates an abstract disjunction.</td></tr>
- <tr><td valign="top"><a href="#disjunction_body-1">disjunction_body/1</a></td><td>Returns the list of body subtrees of a
- <code>disjunction</code> node.</td></tr>
- <tr><td valign="top"><a href="#eof_marker-0">eof_marker/0</a></td><td>Creates an abstract end-of-file marker.</td></tr>
- <tr><td valign="top"><a href="#error_marker-1">error_marker/1</a></td><td>Creates an abstract error marker.</td></tr>
- <tr><td valign="top"><a href="#error_marker_info-1">error_marker_info/1</a></td><td>Returns the ErrorInfo structure of an <code>error_marker</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#flatten_form_list-1">flatten_form_list/1</a></td><td>Flattens sublists of a <code>form_list</code> node.</td></tr>
- <tr><td valign="top"><a href="#float-1">float/1</a></td><td>Creates an abstract floating-point literal.</td></tr>
- <tr><td valign="top"><a href="#float_literal-1">float_literal/1</a></td><td>Returns the numeral string represented by a <code>float</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#float_value-1">float_value/1</a></td><td>Returns the value represented by a <code>float</code> node.</td></tr>
- <tr><td valign="top"><a href="#form_list-1">form_list/1</a></td><td>Creates an abstract sequence of "source code forms".</td></tr>
- <tr><td valign="top"><a href="#form_list_elements-1">form_list_elements/1</a></td><td>Returns the list of subnodes of a <code>form_list</code> node.</td></tr>
- <tr><td valign="top"><a href="#fun_expr-1">fun_expr/1</a></td><td>Creates an abstract fun-expression.</td></tr>
- <tr><td valign="top"><a href="#fun_expr_arity-1">fun_expr_arity/1</a></td><td>Returns the arity of a <code>fun_expr</code> node.</td></tr>
- <tr><td valign="top"><a href="#fun_expr_clauses-1">fun_expr_clauses/1</a></td><td>Returns the list of clause subtrees of a <code>fun_expr</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#function-2">function/2</a></td><td>Creates an abstract function definition.</td></tr>
- <tr><td valign="top"><a href="#function_arity-1">function_arity/1</a></td><td>Returns the arity of a <code>function</code> node.</td></tr>
- <tr><td valign="top"><a href="#function_clauses-1">function_clauses/1</a></td><td>Returns the list of clause subtrees of a <code>function</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#function_name-1">function_name/1</a></td><td>Returns the name subtree of a <code>function</code> node.</td></tr>
- <tr><td valign="top"><a href="#generator-2">generator/2</a></td><td>Creates an abstract generator.</td></tr>
- <tr><td valign="top"><a href="#generator_body-1">generator_body/1</a></td><td>Returns the body subtree of a <code>generator</code> node.</td></tr>
- <tr><td valign="top"><a href="#generator_pattern-1">generator_pattern/1</a></td><td>Returns the pattern subtree of a <code>generator</code> node.</td></tr>
- <tr><td valign="top"><a href="#get_ann-1">get_ann/1</a></td><td>Returns the list of user annotations associated with a syntax
- tree node.</td></tr>
- <tr><td valign="top"><a href="#get_attrs-1">get_attrs/1</a></td><td>Returns a representation of the attributes associated with a
- syntax tree node.</td></tr>
- <tr><td valign="top"><a href="#get_pos-1">get_pos/1</a></td><td>Returns the position information associated with
- <code>Node</code>.</td></tr>
- <tr><td valign="top"><a href="#get_postcomments-1">get_postcomments/1</a></td><td>Returns the associated post-comments of a node.</td></tr>
- <tr><td valign="top"><a href="#get_precomments-1">get_precomments/1</a></td><td>Returns the associated pre-comments of a node.</td></tr>
- <tr><td valign="top"><a href="#has_comments-1">has_comments/1</a></td><td>Yields <code>false</code> if the node has no associated
- comments, and <code>true</code> otherwise.</td></tr>
- <tr><td valign="top"><a href="#if_expr-1">if_expr/1</a></td><td>Creates an abstract if-expression.</td></tr>
- <tr><td valign="top"><a href="#if_expr_clauses-1">if_expr_clauses/1</a></td><td>Returns the list of clause subtrees of an <code>if_expr</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#implicit_fun-1">implicit_fun/1</a></td><td>Creates an abstract "implicit fun" expression.</td></tr>
- <tr><td valign="top"><a href="#implicit_fun-2">implicit_fun/2</a></td><td>Creates an abstract "implicit fun" expression.</td></tr>
- <tr><td valign="top"><a href="#implicit_fun_name-1">implicit_fun_name/1</a></td><td>Returns the name subtree of an <code>implicit_fun</code> node.</td></tr>
- <tr><td valign="top"><a href="#infix_expr-3">infix_expr/3</a></td><td>Creates an abstract infix operator expression.</td></tr>
- <tr><td valign="top"><a href="#infix_expr_left-1">infix_expr_left/1</a></td><td>Returns the left argument subtree of an
- <code>infix_expr</code> node.</td></tr>
- <tr><td valign="top"><a href="#infix_expr_operator-1">infix_expr_operator/1</a></td><td>Returns the operator subtree of an <code>infix_expr</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#infix_expr_right-1">infix_expr_right/1</a></td><td>Returns the right argument subtree of an
- <code>infix_expr</code> node.</td></tr>
- <tr><td valign="top"><a href="#integer-1">integer/1</a></td><td>Creates an abstract integer literal.</td></tr>
- <tr><td valign="top"><a href="#integer_literal-1">integer_literal/1</a></td><td>Returns the numeral string represented by an
- <code>integer</code> node.</td></tr>
- <tr><td valign="top"><a href="#integer_value-1">integer_value/1</a></td><td>Returns the value represented by an <code>integer</code> node.</td></tr>
- <tr><td valign="top"><a href="#is_atom-2">is_atom/2</a></td><td>Returns <code>true</code> if <code>Node</code> has type
- <code>atom</code> and represents <code>Value</code>, otherwise
- <code>false</code>.</td></tr>
- <tr><td valign="top"><a href="#is_char-2">is_char/2</a></td><td>Returns <code>true</code> if <code>Node</code> has type
- <code>char</code> and represents <code>Value</code>, otherwise
- <code>false</code>.</td></tr>
- <tr><td valign="top"><a href="#is_form-1">is_form/1</a></td><td>Returns <code>true</code> if <code>Node</code> is a syntax tree
- representing a so-called "source code form", otherwise
- <code>false</code>.</td></tr>
- <tr><td valign="top"><a href="#is_integer-2">is_integer/2</a></td><td>Returns <code>true</code> if <code>Node</code> has type
- <code>integer</code> and represents <code>Value</code>, otherwise
- <code>false</code>.</td></tr>
- <tr><td valign="top"><a href="#is_leaf-1">is_leaf/1</a></td><td>Returns <code>true</code> if <code>Node</code> is a leaf node,
- otherwise <code>false</code>.</td></tr>
- <tr><td valign="top"><a href="#is_list_skeleton-1">is_list_skeleton/1</a></td><td>Returns <code>true</code> if <code>Node</code> has type
- <code>list</code> or <code>nil</code>, otherwise <code>false</code>.</td></tr>
- <tr><td valign="top"><a href="#is_literal-1">is_literal/1</a></td><td>Returns <code>true</code> if <code>Node</code> represents a
- literal term, otherwise <code>false</code>.</td></tr>
- <tr><td valign="top"><a href="#is_proper_list-1">is_proper_list/1</a></td><td>Returns <code>true</code> if <code>Node</code> represents a
- proper list, and <code>false</code> otherwise.</td></tr>
- <tr><td valign="top"><a href="#is_string-2">is_string/2</a></td><td>Returns <code>true</code> if <code>Node</code> has type
- <code>string</code> and represents <code>Value</code>, otherwise
- <code>false</code>.</td></tr>
- <tr><td valign="top"><a href="#is_tree-1">is_tree/1</a></td><td><em>For special purposes only</em>.</td></tr>
- <tr><td valign="top"><a href="#join_comments-2">join_comments/2</a></td><td>Appends the comments of <code>Source</code> to the current
- comments of <code>Target</code>.</td></tr>
- <tr><td valign="top"><a href="#list-1">list/1</a></td><td><p>Equivalent to <a href="#list-2"><tt>list(List, none)</tt></a>.</p>
- </td></tr>
- <tr><td valign="top"><a href="#list-2">list/2</a></td><td>Constructs an abstract list skeleton.</td></tr>
- <tr><td valign="top"><a href="#list_comp-2">list_comp/2</a></td><td>Creates an abstract list comprehension.</td></tr>
- <tr><td valign="top"><a href="#list_comp_body-1">list_comp_body/1</a></td><td>Returns the list of body subtrees of a <code>list_comp</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#list_comp_template-1">list_comp_template/1</a></td><td>Returns the template subtree of a <code>list_comp</code> node.</td></tr>
- <tr><td valign="top"><a href="#list_elements-1">list_elements/1</a></td><td>Returns the list of element subtrees of a list skeleton.</td></tr>
- <tr><td valign="top"><a href="#list_head-1">list_head/1</a></td><td>Returns the head element subtree of a <code>list</code> node.</td></tr>
- <tr><td valign="top"><a href="#list_length-1">list_length/1</a></td><td>Returns the number of element subtrees of a list skeleton.</td></tr>
- <tr><td valign="top"><a href="#list_prefix-1">list_prefix/1</a></td><td>Returns the prefix element subtrees of a <code>list</code> node.</td></tr>
- <tr><td valign="top"><a href="#list_suffix-1">list_suffix/1</a></td><td>Returns the suffix subtree of a <code>list</code> node, if one
- exists.</td></tr>
- <tr><td valign="top"><a href="#list_tail-1">list_tail/1</a></td><td>Returns the tail of a <code>list</code> node.</td></tr>
- <tr><td valign="top"><a href="#macro-1">macro/1</a></td><td><p>Equivalent to <a href="#macro-2"><tt>macro(Name, none)</tt></a>.</p>
- </td></tr>
- <tr><td valign="top"><a href="#macro-2">macro/2</a></td><td>Creates an abstract macro application.</td></tr>
- <tr><td valign="top"><a href="#macro_arguments-1">macro_arguments/1</a></td><td>Returns the list of argument subtrees of a <code>macro</code>
- node, if any.</td></tr>
- <tr><td valign="top"><a href="#macro_name-1">macro_name/1</a></td><td>Returns the name subtree of a <code>macro</code> node.</td></tr>
- <tr><td valign="top"><a href="#make_tree-2">make_tree/2</a></td><td>Creates a syntax tree with the given type and subtrees.</td></tr>
- <tr><td valign="top"><a href="#match_expr-2">match_expr/2</a></td><td>Creates an abstract match-expression.</td></tr>
- <tr><td valign="top"><a href="#match_expr_body-1">match_expr_body/1</a></td><td>Returns the body subtree of a <code>match_expr</code> node.</td></tr>
- <tr><td valign="top"><a href="#match_expr_pattern-1">match_expr_pattern/1</a></td><td>Returns the pattern subtree of a <code>match_expr</code> node.</td></tr>
- <tr><td valign="top"><a href="#meta-1">meta/1</a></td><td>Creates a meta-representation of a syntax tree.</td></tr>
- <tr><td valign="top"><a href="#module_qualifier-2">module_qualifier/2</a></td><td>Creates an abstract module qualifier.</td></tr>
- <tr><td valign="top"><a href="#module_qualifier_argument-1">module_qualifier_argument/1</a></td><td>Returns the argument (the module) subtree of a
- <code>module_qualifier</code> node.</td></tr>
- <tr><td valign="top"><a href="#module_qualifier_body-1">module_qualifier_body/1</a></td><td>Returns the body subtree of a <code>module_qualifier</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#nil-0">nil/0</a></td><td>Creates an abstract empty list.</td></tr>
- <tr><td valign="top"><a href="#normalize_list-1">normalize_list/1</a></td><td>Expands an abstract list skeleton to its most explicit form.</td></tr>
- <tr><td valign="top"><a href="#operator-1">operator/1</a></td><td>Creates an abstract operator.</td></tr>
- <tr><td valign="top"><a href="#operator_literal-1">operator_literal/1</a></td><td>Returns the literal string represented by an
- <code>operator</code> node.</td></tr>
- <tr><td valign="top"><a href="#operator_name-1">operator_name/1</a></td><td>Returns the name of an <code>operator</code> node.</td></tr>
- <tr><td valign="top"><a href="#parentheses-1">parentheses/1</a></td><td>Creates an abstract parenthesised expression.</td></tr>
- <tr><td valign="top"><a href="#parentheses_body-1">parentheses_body/1</a></td><td>Returns the body subtree of a <code>parentheses</code> node.</td></tr>
- <tr><td valign="top"><a href="#prefix_expr-2">prefix_expr/2</a></td><td>Creates an abstract prefix operator expression.</td></tr>
- <tr><td valign="top"><a href="#prefix_expr_argument-1">prefix_expr_argument/1</a></td><td>Returns the argument subtree of a <code>prefix_expr</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#prefix_expr_operator-1">prefix_expr_operator/1</a></td><td>Returns the operator subtree of a <code>prefix_expr</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#qualified_name-1">qualified_name/1</a></td><td>Creates an abstract qualified name.</td></tr>
- <tr><td valign="top"><a href="#qualified_name_segments-1">qualified_name_segments/1</a></td><td>Returns the list of name segments of a
- <code>qualified_name</code> node.</td></tr>
- <tr><td valign="top"><a href="#query_expr-1">query_expr/1</a></td><td>Creates an abstract Mnemosyne query expression.</td></tr>
- <tr><td valign="top"><a href="#query_expr_body-1">query_expr_body/1</a></td><td>Returns the body subtree of a <code>query_expr</code> node.</td></tr>
- <tr><td valign="top"><a href="#receive_expr-1">receive_expr/1</a></td><td><p>Equivalent to <a href="#receive_expr-3"><tt>receive_expr(Clauses, none, [])</tt></a>.</p>
- </td></tr>
- <tr><td valign="top"><a href="#receive_expr-3">receive_expr/3</a></td><td>Creates an abstract receive-expression.</td></tr>
- <tr><td valign="top"><a href="#receive_expr_action-1">receive_expr_action/1</a></td><td>Returns the list of action body subtrees of a
- <code>receive_expr</code> node.</td></tr>
- <tr><td valign="top"><a href="#receive_expr_clauses-1">receive_expr_clauses/1</a></td><td>Returns the list of clause subtrees of a
- <code>receive_expr</code> node.</td></tr>
- <tr><td valign="top"><a href="#receive_expr_timeout-1">receive_expr_timeout/1</a></td><td>Returns the timeout subtree of a <code>receive_expr</code> node,
- if any.</td></tr>
- <tr><td valign="top"><a href="#record_access-2">record_access/2</a></td><td><p>Equivalent to <a href="#record_access-3"><tt>record_access(Argument, none, Field)</tt></a>.</p>
- </td></tr>
- <tr><td valign="top"><a href="#record_access-3">record_access/3</a></td><td>Creates an abstract record field access expression.</td></tr>
- <tr><td valign="top"><a href="#record_access_argument-1">record_access_argument/1</a></td><td>Returns the argument subtree of a <code>record_access</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#record_access_field-1">record_access_field/1</a></td><td>Returns the field subtree of a <code>record_access</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#record_access_type-1">record_access_type/1</a></td><td>Returns the type subtree of a <code>record_access</code> node,
- if any.</td></tr>
- <tr><td valign="top"><a href="#record_expr-2">record_expr/2</a></td><td><p>Equivalent to <a href="#record_expr-3"><tt>record_expr(none, Type, Fields)</tt></a>.</p>
- </td></tr>
- <tr><td valign="top"><a href="#record_expr-3">record_expr/3</a></td><td>Creates an abstract record expression.</td></tr>
- <tr><td valign="top"><a href="#record_expr_argument-1">record_expr_argument/1</a></td><td>Returns the argument subtree of a <code>record_expr</code> node,
- if any.</td></tr>
- <tr><td valign="top"><a href="#record_expr_fields-1">record_expr_fields/1</a></td><td>Returns the list of field subtrees of a
- <code>record_expr</code> node.</td></tr>
- <tr><td valign="top"><a href="#record_expr_type-1">record_expr_type/1</a></td><td>Returns the type subtree of a <code>record_expr</code> node.</td></tr>
- <tr><td valign="top"><a href="#record_field-1">record_field/1</a></td><td><p>Equivalent to <a href="#record_field-2"><tt>record_field(Name, none)</tt></a>.</p>
- </td></tr>
- <tr><td valign="top"><a href="#record_field-2">record_field/2</a></td><td>Creates an abstract record field specification.</td></tr>
- <tr><td valign="top"><a href="#record_field_name-1">record_field_name/1</a></td><td>Returns the name subtree of a <code>record_field</code> node.</td></tr>
- <tr><td valign="top"><a href="#record_field_value-1">record_field_value/1</a></td><td>Returns the value subtree of a <code>record_field</code> node,
- if any.</td></tr>
- <tr><td valign="top"><a href="#record_index_expr-2">record_index_expr/2</a></td><td>Creates an abstract record field index expression.</td></tr>
- <tr><td valign="top"><a href="#record_index_expr_field-1">record_index_expr_field/1</a></td><td>Returns the field subtree of a <code>record_index_expr</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#record_index_expr_type-1">record_index_expr_type/1</a></td><td>Returns the type subtree of a <code>record_index_expr</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#remove_comments-1">remove_comments/1</a></td><td>Clears the associated comments of <code>Node</code>.</td></tr>
- <tr><td valign="top"><a href="#revert-1">revert/1</a></td><td>Returns an <code>erl_parse</code>-compatible representation of a
- syntax tree, if possible.</td></tr>
- <tr><td valign="top"><a href="#revert_forms-1">revert_forms/1</a></td><td>Reverts a sequence of Erlang source code forms.</td></tr>
- <tr><td valign="top"><a href="#rule-2">rule/2</a></td><td>Creates an abstract Mnemosyne rule.</td></tr>
- <tr><td valign="top"><a href="#rule_arity-1">rule_arity/1</a></td><td>Returns the arity of a <code>rule</code> node.</td></tr>
- <tr><td valign="top"><a href="#rule_clauses-1">rule_clauses/1</a></td><td>Returns the list of clause subtrees of a <code>rule</code> node.</td></tr>
- <tr><td valign="top"><a href="#rule_name-1">rule_name/1</a></td><td>Returns the name subtree of a <code>rule</code> node.</td></tr>
- <tr><td valign="top"><a href="#set_ann-2">set_ann/2</a></td><td>Sets the list of user annotations of <code>Node</code> to
- <code>Annotations</code>.</td></tr>
- <tr><td valign="top"><a href="#set_attrs-2">set_attrs/2</a></td><td>Sets the attributes of <code>Node</code> to
- <code>Attributes</code>.</td></tr>
- <tr><td valign="top"><a href="#set_pos-2">set_pos/2</a></td><td>Sets the position information of <code>Node</code> to
- <code>Pos</code>.</td></tr>
- <tr><td valign="top"><a href="#set_postcomments-2">set_postcomments/2</a></td><td>Sets the post-comments of <code>Node</code> to
- <code>Comments</code>.</td></tr>
- <tr><td valign="top"><a href="#set_precomments-2">set_precomments/2</a></td><td>Sets the pre-comments of <code>Node</code> to
- <code>Comments</code>.</td></tr>
- <tr><td valign="top"><a href="#size_qualifier-2">size_qualifier/2</a></td><td>Creates an abstract size qualifier.</td></tr>
- <tr><td valign="top"><a href="#size_qualifier_argument-1">size_qualifier_argument/1</a></td><td>Returns the argument subtree (the size) of a
- <code>size_qualifier</code> node.</td></tr>
- <tr><td valign="top"><a href="#size_qualifier_body-1">size_qualifier_body/1</a></td><td>Returns the body subtree of a <code>size_qualifier</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#string-1">string/1</a></td><td>Creates an abstract string literal.</td></tr>
- <tr><td valign="top"><a href="#string_literal-1">string_literal/1</a></td><td>Returns the literal string represented by a <code>string</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#string_value-1">string_value/1</a></td><td>Returns the value represented by a <code>string</code> node.</td></tr>
- <tr><td valign="top"><a href="#subtrees-1">subtrees/1</a></td><td>Returns the grouped list of all subtrees of a syntax tree.</td></tr>
- <tr><td valign="top"><a href="#text-1">text/1</a></td><td>Creates an abstract piece of source code text.</td></tr>
- <tr><td valign="top"><a href="#text_string-1">text_string/1</a></td><td>Returns the character sequence represented by a
- <code>text</code> node.</td></tr>
- <tr><td valign="top"><a href="#tree-1">tree/1</a></td><td><p>Equivalent to <a href="#tree-2"><tt>tree(Type, [])</tt></a>.</p>
- </td></tr>
- <tr><td valign="top"><a href="#tree-2">tree/2</a></td><td><em>For special purposes only</em>.</td></tr>
- <tr><td valign="top"><a href="#try_after_expr-2">try_after_expr/2</a></td><td><p>Equivalent to <a href="#try_expr-4"><tt>try_expr(Body, [], [], After)</tt></a>.</p>
- </td></tr>
- <tr><td valign="top"><a href="#try_expr-2">try_expr/2</a></td><td><p>Equivalent to <a href="#try_expr-3"><tt>try_expr(Body, [], Handlers)</tt></a>.</p>
- </td></tr>
- <tr><td valign="top"><a href="#try_expr-3">try_expr/3</a></td><td><p>Equivalent to <a href="#try_expr-4"><tt>try_expr(Body, Clauses, Handlers, [])</tt></a>.</p>
- </td></tr>
- <tr><td valign="top"><a href="#try_expr-4">try_expr/4</a></td><td>Creates an abstract try-expression.</td></tr>
- <tr><td valign="top"><a href="#try_expr_after-1">try_expr_after/1</a></td><td>Returns the list of "after" subtrees of a <code>try_expr</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#try_expr_body-1">try_expr_body/1</a></td><td>Returns the list of body subtrees of a <code>try_expr</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#try_expr_clauses-1">try_expr_clauses/1</a></td><td>Returns the list of case-clause subtrees of a
- <code>try_expr</code> node.</td></tr>
- <tr><td valign="top"><a href="#try_expr_handlers-1">try_expr_handlers/1</a></td><td>Returns the list of handler-clause subtrees of a
- <code>try_expr</code> node.</td></tr>
- <tr><td valign="top"><a href="#tuple-1">tuple/1</a></td><td>Creates an abstract tuple.</td></tr>
- <tr><td valign="top"><a href="#tuple_elements-1">tuple_elements/1</a></td><td>Returns the list of element subtrees of a <code>tuple</code>
- node.</td></tr>
- <tr><td valign="top"><a href="#tuple_size-1">tuple_size/1</a></td><td>Returns the number of elements of a <code>tuple</code> node.</td></tr>
- <tr><td valign="top"><a href="#type-1">type/1</a></td><td>Returns the type tag of <code>Node</code>.</td></tr>
- <tr><td valign="top"><a href="#underscore-0">underscore/0</a></td><td>Creates an abstract universal pattern ("<code>_</code>").</td></tr>
- <tr><td valign="top"><a href="#update_tree-2">update_tree/2</a></td><td>Creates a syntax tree with the same type and attributes as the
- given tree.</td></tr>
- <tr><td valign="top"><a href="#variable-1">variable/1</a></td><td>Creates an abstract variable with the given name.</td></tr>
- <tr><td valign="top"><a href="#variable_literal-1">variable_literal/1</a></td><td>Returns the name of a <code>variable</code> node as a string.</td></tr>
- <tr><td valign="top"><a href="#variable_name-1">variable_name/1</a></td><td>Returns the name of a <code>variable</code> node as an atom.</td></tr>
- <tr><td valign="top"><a href="#warning_marker-1">warning_marker/1</a></td><td>Creates an abstract warning marker.</td></tr>
- <tr><td valign="top"><a href="#warning_marker_info-1">warning_marker_info/1</a></td><td>Returns the ErrorInfo structure of a <code>warning_marker</code>
- node.</td></tr>
- </table>
- <h2><a name="functions">Function Details</a></h2>
- <h3><a name="abstract-1">abstract/1</a></h3>
- <p><tt>abstract(Term::term()) -> <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Returns the syntax tree corresponding to an Erlang term.
- <code>Term</code> must be a literal term, i.e., one that can be
- represented as a source code literal. Thus, it may not contain a
- process identifier, port, reference, binary or function value as a
- subterm. The function recognises printable strings, in order to get a
- compact and readable representation. Evaluation fails with reason
- <code>badarg</code> if <code>Term</code> is not a literal term.
- </p>
- <p><b>See also:</b> <a href="#concrete-1">concrete/1</a>, <a href="#is_literal-1">is_literal/1</a>.</p>
- <h3><a name="add_ann-2">add_ann/2</a></h3>
- <p><tt>add_ann(Annotation::term(), Node::<a href="#type-syntaxTree">syntaxTree()</a>) -> <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Appends the term <code>Annotation</code> to the list of user
- annotations of <code>Node</code>.
-
- <p>Note: this is equivalent to <code>set_ann(Node, [Annotation |
- get_ann(Node)])</code>, but potentially more efficient.</p>
- </p>
- <p><b>See also:</b> <a href="#get_ann-1">get_ann/1</a>, <a href="#set_ann-2">set_ann/2</a>.</p>
- <h3><a name="add_postcomments-2">add_postcomments/2</a></h3>
- <p><tt>add_postcomments(Comments::[<a href="#type-syntaxTree">syntaxTree()</a>], Node::<a href="#type-syntaxTree">syntaxTree()</a>) -> <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Appends <code>Comments</code> to the post-comments of
- <code>Node</code>.
-
- <p>Note: This is equivalent to <code>set_postcomments(Node,
- get_postcomments(Node) ++ Comments)</code>, but potentially more
- efficient.</p>
- </p>
- <p><b>See also:</b> <a href="#add_precomments-2">add_precomments/2</a>, <a href="#comment-2">comment/2</a>, <a href="#get_postcomments-1">get_postcomments/1</a>, <a href="#join_comments-2">join_comments/2</a>, <a href="#set_postcomments-2">set_postcomments/2</a>.</p>
- <h3><a name="add_precomments-2">add_precomments/2</a></h3>
- <p><tt>add_precomments(Comments::[<a href="#type-syntaxTree">syntaxTree()</a>], Node::<a href="#type-syntaxTree">syntaxTree()</a>) -> <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Appends <code>Comments</code> to the pre-comments of
- <code>Node</code>.
-
- <p>Note: This is equivalent to <code>set_precomments(Node,
- get_precomments(Node) ++ Comments)</code>, but potentially more
- efficient.</p>
- </p>
- <p><b>See also:</b> <a href="#add_postcomments-2">add_postcomments/2</a>, <a href="#comment-2">comment/2</a>, <a href="#get_precomments-1">get_precomments/1</a>, <a href="#join_comments-2">join_comments/2</a>, <a href="#set_precomments-2">set_precomments/2</a>.</p>
- <h3><a name="application-2">application/2</a></h3>
- <p><tt>application(Operator::<a href="#type-syntaxTree">syntaxTree()</a>, Arguments::[<a href="#type-syntaxTree">syntaxTree()</a>]) -> <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Creates an abstract function application expression. If
- <code>Arguments</code> is <code>[A1, ..., An]</code>, the result
- represents "<code><em>Operator</em>(<em>A1</em>, ...,
- <em>An</em>)</code>".
- </p>
- <p><b>See also:</b> <a href="#application-3">application/3</a>, <a href="#application_arguments-1">application_arguments/1</a>, <a href="#application_operator-1">application_operator/1</a>.</p>
- <h3><a name="application-3">application/3</a></h3>
- <p><tt>application(Module, Function::<a href="#type-syntaxTree">syntaxTree()</a>, Arguments::[<a href="#type-syntaxTree">syntaxTree()</a>]) -> <a href="#type-syntaxTree">syntaxTree()</a></tt>
- <ul><li><tt>Module = none | <a href="#type-syntaxTree">syntaxTree()</a></tt></li></ul></p>
- <p>Creates an abstract function application expression. (Utility
- function.) If <code>Module</code> is <code>none</code>, this is
- call is equivalent to <code>application(Function,
- Arguments)</code>, otherwise it is equivalent to
- <code>application(module_qualifier(Module, Function),
- Arguments)</code>.
- </p>
- <p><b>See also:</b> <a href="#application-2">application/2</a>, <a href="#module_qualifier-2">module_qualifier/2</a>.</p>
- <h3><a name="application_arguments-1">application_arguments/1</a></h3>
- <p><tt>application_arguments(Node::<a href="#type-syntaxTree">syntaxTree()</a>) -> [<a href="#type-syntaxTree">syntaxTree()</a>]</tt></p>
- <p>Returns the list of argument subtrees of an
- <code>application</code> node.
- </p>
- <p><b>See also:</b> <a href="#application-2">application/2</a>.</p>
- <h3><a name="application_operator-1">application_operator/1</a></h3>
- <p><tt>application_operator(Node::<a href="#type-syntaxTree">syntaxTree()</a>) -> <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Returns the operator subtree of an <code>application</code>
- node.
-
- <p>Note: if <code>Node</code> represents
- "<code><em>M</em>:<em>F</em>(...)</code>", then the result is the
- subtree representing "<code><em>M</em>:<em>F</em></code>".</p>
- </p>
- <p><b>See also:</b> <a href="#application-2">application/2</a>, <a href="#module_qualifier-2">module_qualifier/2</a>.</p>
- <h3><a name="arity_qualifier-2">arity_qualifier/2</a></h3>
- <p><tt>arity_qualifier(Body::<a href="#type-syntaxTree">syntaxTree()</a>, Arity::<a href="#type-syntaxTree">syntaxTree()</a>) -> <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Creates an abstract arity qualifier. The result represents
- "<code><em>Body</em>/<em>Arity</em></code>".
- </p>
- <p><b>See also:</b> <a href="#arity_qualifier_argument-1">arity_qualifier_argument/1</a>, <a href="#arity_qualifier_body-1">arity_qualifier_body/1</a>.</p>
- <h3><a name="arity_qualifier_argument-1">arity_qualifier_argument/1</a></h3>
- <p><tt>arity_qualifier_argument(Node::<a href="#type-syntaxTree">syntaxTree()</a>) -> <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Returns the argument (the arity) subtree of an
- <code>arity_qualifier</code> node.
- </p>
- <p><b>See also:</b> <a href="#arity_qualifier-1">arity_qualifier/1</a>.</p>
- <h3><a name="arity_qualifier_body-1">arity_qualifier_body/1</a></h3>
- <p><tt>arity_qualifier_body(Node::<a href="#type-syntaxTree">syntaxTree()</a>) -> <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Returns the body subtree of an <code>arity_qualifier</code>
- node.
- </p>
- <p><b>See also:</b> <a href="#arity_qualifier-1">arity_qualifier/1</a>.</p>
- <h3><a name="atom-1">atom/1</a></h3>
- <p><tt>atom(Name) -> <a href="#type-syntaxTree">syntaxTree()</a></tt>
- <ul><li><tt>Name = atom() | string()</tt></li></ul></p>
- <p>Creates an abstract atom literal. The print name of the atom is
- the character sequence represented by <code>Name</code>.
- </p>
- <p><b>See also:</b> <a href="#atom_literal-1">atom_literal/1</a>, <a href="#atom_name-1">atom_name/1</a>, <a href="#atom_value-1">atom_value/1</a>, <a href="#is_atom-2">is_atom/2</a>.</p>
- <h3><a name="atom_literal-1">atom_literal/1</a></h3>
- <p><tt>atom_literal(Node::<a href="#type-syntaxTree">syntaxTree()</a>) -> string()</tt></p>
- <p>Returns the literal string represented by an <code>atom</code>
- node. This includes surrounding single-quote characters if necessary.
-
- <p>Note that e.g. the result of <code>atom("x\ny")</code> represents
- any and all of <code>'x\ny'</code>, <code>'x\12y'</code>,
- <code>'x\012y'</code> and <code>'x\^Jy\'</code>; cf.
- <code>string/1</code>.</p>
- </p>
- <p><b>See also:</b> <a href="#atom-1">atom/1</a>, <a href="#string-1">string/1</a>.</p>
- <h3><a name="atom_name-1">atom_name/1</a></h3>
- <p><tt>atom_name(Node::<a href="#type-syntaxTree">syntaxTree()</a>) -> string()</tt></p>
- <p>Returns the printname of an <code>atom</code> node.
- </p>
- <p><b>See also:</b> <a href="#atom-1">atom/1</a>.</p>
- <h3><a name="atom_value-1">atom_value/1</a></h3>
- <p><tt>atom_value(Node::<a href="#type-syntaxTree">syntaxTree()</a>) -> atom()</tt></p>
- <p>Returns the value represented by an <code>atom</code> node.
- </p>
- <p><b>See also:</b> <a href="#atom-1">atom/1</a>.</p>
- <h3><a name="attribute-1">attribute/1</a></h3>
- <p><tt>attribute(Name) -> <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Equivalent to <a href="#attribute-2"><tt>attribute(Name, none)</tt></a>.</p>
- <h3><a name="attribute-2">attribute/2</a></h3>
- <p><tt>attribute(Name::<a href="#type-syntaxTree">syntaxTree()</a>, Args::Arguments) -> <a href="#type-syntaxTree">syntaxTree()</a></tt>
- <ul><li><tt>Arguments = none | [<a href="#type-syntaxTree">syntaxTree()</a>]</tt></li></ul></p>
- <p>Creates an abstract program attribute. If
- <code>Arguments</code> is <code>[A1, ..., An]</code>, the result
- represents "<code>-<em>Name</em>(<em>A1</em>, ...,
- <em>An</em>).</code>". Otherwise, if <code>Arguments</code> is
- <code>none</code>, the result represents
- "<code>-<em>Name</em>.</code>". The latter form makes it possible
- to represent preprocessor directives such as
- "<code>-endif.</code>". Attributes are source code forms.
-
- <p>Note: The preprocessor macro definition directive
- "<code>-define(<em>Name</em>, <em>Body</em>).</code>" has relatively
- few requirements on the syntactical form of <code>Body</code> (viewed
- as a sequence of tokens). The <code>text</code> node type can be used
- for a <code>Body</code> that is not a normal Erlang construct.</p>
- </p>
- <p><b>See also:</b> <a href="#attribute-1">attribute/1</a>, <a href="#attribute_arguments-1">attribute_arguments/1</a>, <a href="#attribute_name-1">attribute_name/1</a>, <a href="#is_form-1">is_form/1</a>, <a href="#text-1">text/1</a>.</p>
- <h3><a name="attribute_arguments-1">attribute_arguments/1</a></h3>
- <p><tt>attribute_arguments(Node::<a href="#type-syntaxTree">syntaxTree()</a>) -> none | [<a href="#type-syntaxTree">syntaxTree()</a>]</tt></p>
- <p>Returns the list of argument subtrees of an
- <code>attribute</code> node, if any. If <code>Node</code>
- represents "<code>-<em>Name</em>.</code>", the result is
- <code>none</code>. Otherwise, if <code>Node</code> represents
- "<code>-<em>Name</em>(<em>E1</em>, ..., <em>En</em>).</code>",
- <code>[E1, ..., E1]</code> is returned.
- </p>
- <p><b>See also:</b> <a href="#attribute-1">attribute/1</a>.</p>
- <h3><a name="attribute_name-1">attribute_name/1</a></h3>
- <p><tt>attribute_name(Node::<a href="#type-syntaxTree">syntaxTree()</a>) -> <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Returns the name subtree of an <code>attribute</code> node.
- </p>
- <p><b>See also:</b> <a href="#attribute-1">attribute/1</a>.</p>
- <h3><a name="binary-1">binary/1</a></h3>
- <p><tt>binary(Fields::[<a href="#type-syntaxTree">syntaxTree()</a>]) -> <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Creates an abstract binary-object template. If
- <code>Fields</code> is <code>[F1, ..., Fn]</code>, the result
- represents "<code><<<em>F1</em>, ...,
- <em>Fn</em>>></code>".
- </p>
- <p><b>See also:</b> <a href="#binary_field-2">binary_field/2</a>, <a href="#binary_fields-1">binary_fields/1</a>.</p>
- <h3><a name="binary_field-1">binary_field/1</a></h3>
- <p><tt>binary_field(Body) -> <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Equivalent to <a href="#binary_field-2"><tt>binary_field(Body, [])</tt></a>.</p>
- <h3><a name="binary_field-2">binary_field/2</a></h3>
- <p><tt>binary_field(Body::<a href="#type-syntaxTree">syntaxTree()</a>, Types::[<a href="#type-syntaxTree">syntaxTree()</a>]) -> <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Creates an abstract binary template field. If
- <code>Types</code> is the empty list, the result simply represents
- "<code><em>Body</em></code>", otherwise, if <code>Types</code> is
- <code>[T1, ..., Tn]</code>, the result represents
- "<code><em>Body</em>/<em>T1</em>-...-<em>Tn</em></code>".
- </p>
- <p><b>See also:</b> <a href="#binary-1">binary/1</a>, <a href="#binary_field-1">binary_field/1</a>, <a href="#binary_field-3">binary_field/3</a>, <a href="#binary_field_body-1">binary_field_body/1</a>, <a href="#binary_field_size-1">binary_field_size/1</a>, <a href="#binary_field_types-1">binary_field_types/1</a>.</p>
- <h3><a name="binary_field-3">binary_field/3</a></h3>
- <p><tt>binary_field(Body::<a href="#type-syntaxTree">syntaxTree()</a>, Size, Types::[<a href="#type-syntaxTree">syntaxTree()</a>]) -> <a href="#type-syntaxTree">syntaxTree()</a></tt>
- <ul><li><tt>Size = none | <a href="#type-syntaxTree">syntaxTree()</a></tt></li></ul></p>
- <p>Creates an abstract binary template field. (Utility function.)
- If <code>Size</code> is <code>none</code>, this is equivalent to
- "<code>binary_field(Body, Types)</code>", otherwise it is
- equivalent to "<code>binary_field(size_qualifier(Body, Size),
- Types)</code>".
- </p>
- <p><b>See also:</b> <a href="#binary-1">binary/1</a>, <a href="#binary_field-2">binary_field/2</a>, <a href="#size_qualifier-2">size_qualifier/2</a>.</p>
- <h3><a name="binary_field_body-1">binary_field_body/1</a></h3>
- <p><tt>binary_field_body(Node::<a href="#type-syntaxTree">syntaxTree()</a>) -> <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Returns the body subtree of a <code>binary_field</code>.
- </p>
- <p><b>See also:</b> <a href="#binary_field-2">binary_field/2</a>.</p>
- <h3><a name="binary_field_size-1">binary_field_size/1</a></h3>
- <p><tt>binary_field_size(Node::<a href="#type-syntaxTree">syntaxTree()</a>) -> none | <a href="#type-syntaxTree">syntaxTree()</a></tt></p>
- <p>Returns the size specifier subtree of a
- <code>binary_field</code> node, if any. (Utility function.) If
- <code>Node</code> represents
- "<code><em>Body</em>:<em>Size</em></code>" or
- "<code><em>Body</em>:<em>Size</em>/<em>T1</em>, ...,
- <em>Tn</em></code>", the result is <code>Size</code>, otherwise
- <code>none</code> is returned.
- </p>
- <p><b>See also:</b> <a href="#binary_field-2">binary_field/2</a>, <a href="#binary_fieā¦
Large files files are truncated, but you can click here to view the full file