man-pages/man3/Ast_iterator.3o.html
2021-03-31 01:06:50 +01:00

285 lines
6.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of Ast_iterator</TITLE>
</HEAD><BODY>
<H1>Ast_iterator</H1>
Section: OCaml library (3o)<BR>Updated: 2020-01-30<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
Ast_iterator - Ast_iterator.iterator enables AST inspection using open recursion.
<A NAME="lbAC">&nbsp;</A>
<H2>Module</H2>
Module Ast_iterator
<A NAME="lbAD">&nbsp;</A>
<H2>Documentation</H2>
<P>
Module
<B>Ast_iterator</B>
<BR>&nbsp;:&nbsp;
<B>sig end</B>
<P>
<P>
<P>
<B>Ast_iterator.iterator</B>
enables AST inspection using open recursion. A
typical mapper would be based on
<B>Ast_iterator.default_iterator</B>
, a trivial iterator,
and will fall back on it for handling the syntax it does not modify.
<P>
Warning: this module is unstable and part of
<B>Compiler_libs</B>
.
<P>
<P>
<P>
<P>
<P>
<P>
<P>
<A NAME="lbAE">&nbsp;</A>
<H3>A generic Parsetree iterator</H3>
<P>
<P>
<I>type iterator </I>
= {
<BR>&nbsp;attribute&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.attribute -&gt; unit</B>
;
<BR>&nbsp;attributes&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.attribute list -&gt; unit</B>
;
<BR>&nbsp;binding_op&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.binding_op -&gt; unit</B>
;
<BR>&nbsp;case&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.case -&gt; unit</B>
;
<BR>&nbsp;cases&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.case list -&gt; unit</B>
;
<BR>&nbsp;class_declaration&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.class_declaration -&gt; unit</B>
;
<BR>&nbsp;class_description&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.class_description -&gt; unit</B>
;
<BR>&nbsp;class_expr&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.class_expr -&gt; unit</B>
;
<BR>&nbsp;class_field&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.class_field -&gt; unit</B>
;
<BR>&nbsp;class_signature&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.class_signature -&gt; unit</B>
;
<BR>&nbsp;class_structure&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.class_structure -&gt; unit</B>
;
<BR>&nbsp;class_type&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.class_type -&gt; unit</B>
;
<BR>&nbsp;class_type_declaration&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.class_type_declaration -&gt; unit</B>
;
<BR>&nbsp;class_type_field&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.class_type_field -&gt; unit</B>
;
<BR>&nbsp;constructor_declaration&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.constructor_declaration -&gt; unit</B>
;
<BR>&nbsp;expr&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.expression -&gt; unit</B>
;
<BR>&nbsp;extension&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.extension -&gt; unit</B>
;
<BR>&nbsp;extension_constructor&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.extension_constructor -&gt; unit</B>
;
<BR>&nbsp;include_declaration&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.include_declaration -&gt; unit</B>
;
<BR>&nbsp;include_description&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.include_description -&gt; unit</B>
;
<BR>&nbsp;label_declaration&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.label_declaration -&gt; unit</B>
;
<BR>&nbsp;location&nbsp;:&nbsp;
<B>iterator -&gt; Location.t -&gt; unit</B>
;
<BR>&nbsp;module_binding&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.module_binding -&gt; unit</B>
;
<BR>&nbsp;module_declaration&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.module_declaration -&gt; unit</B>
;
<BR>&nbsp;module_substitution&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.module_substitution -&gt; unit</B>
;
<BR>&nbsp;module_expr&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.module_expr -&gt; unit</B>
;
<BR>&nbsp;module_type&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.module_type -&gt; unit</B>
;
<BR>&nbsp;module_type_declaration&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.module_type_declaration -&gt; unit</B>
;
<BR>&nbsp;open_declaration&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.open_declaration -&gt; unit</B>
;
<BR>&nbsp;open_description&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.open_description -&gt; unit</B>
;
<BR>&nbsp;pat&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.pattern -&gt; unit</B>
;
<BR>&nbsp;payload&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.payload -&gt; unit</B>
;
<BR>&nbsp;signature&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.signature -&gt; unit</B>
;
<BR>&nbsp;signature_item&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.signature_item -&gt; unit</B>
;
<BR>&nbsp;structure&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.structure -&gt; unit</B>
;
<BR>&nbsp;structure_item&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.structure_item -&gt; unit</B>
;
<BR>&nbsp;typ&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.core_type -&gt; unit</B>
;
<BR>&nbsp;row_field&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.row_field -&gt; unit</B>
;
<BR>&nbsp;object_field&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.object_field -&gt; unit</B>
;
<BR>&nbsp;type_declaration&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.type_declaration -&gt; unit</B>
;
<BR>&nbsp;type_extension&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.type_extension -&gt; unit</B>
;
<BR>&nbsp;type_exception&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.type_exception -&gt; unit</B>
;
<BR>&nbsp;type_kind&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.type_kind -&gt; unit</B>
;
<BR>&nbsp;value_binding&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.value_binding -&gt; unit</B>
;
<BR>&nbsp;value_description&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.value_description -&gt; unit</B>
;
<BR>&nbsp;with_constraint&nbsp;:&nbsp;
<B>iterator -&gt; Parsetree.with_constraint -&gt; unit</B>
;
<BR>&nbsp;}
<P>
<P>
A
<B>iterator</B>
record implements one &quot;method&quot; per syntactic category,
using an open recursion style: each method takes as its first
argument the iterator to be applied to children in the syntax
tree.
<P>
<P>
<P>
<I>val default_iterator </I>
:
<B>iterator</B>
<P>
A default iterator, which implements a &quot;do not do anything&quot; mapping.
<P>
<P>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">Module</A><DD>
<DT id="3"><A HREF="#lbAD">Documentation</A><DD>
<DL>
<DT id="4"><A HREF="#lbAE">A generic Parsetree iterator</A><DD>
</DL>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:36 GMT, March 31, 2021
</BODY>
</HTML>