285 lines
6.2 KiB
HTML
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"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Ast_iterator - Ast_iterator.iterator enables AST inspection using open recursion.
|
|
<A NAME="lbAC"> </A>
|
|
<H2>Module</H2>
|
|
|
|
Module Ast_iterator
|
|
<A NAME="lbAD"> </A>
|
|
<H2>Documentation</H2>
|
|
|
|
<P>
|
|
Module
|
|
<B>Ast_iterator</B>
|
|
|
|
<BR> :
|
|
<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"> </A>
|
|
<H3>A generic Parsetree iterator</H3>
|
|
|
|
<P>
|
|
<P>
|
|
|
|
<I>type iterator </I>
|
|
|
|
= {
|
|
<BR> attribute :
|
|
<B>iterator -> Parsetree.attribute -> unit</B>
|
|
|
|
;
|
|
<BR> attributes :
|
|
<B>iterator -> Parsetree.attribute list -> unit</B>
|
|
|
|
;
|
|
<BR> binding_op :
|
|
<B>iterator -> Parsetree.binding_op -> unit</B>
|
|
|
|
;
|
|
<BR> case :
|
|
<B>iterator -> Parsetree.case -> unit</B>
|
|
|
|
;
|
|
<BR> cases :
|
|
<B>iterator -> Parsetree.case list -> unit</B>
|
|
|
|
;
|
|
<BR> class_declaration :
|
|
<B>iterator -> Parsetree.class_declaration -> unit</B>
|
|
|
|
;
|
|
<BR> class_description :
|
|
<B>iterator -> Parsetree.class_description -> unit</B>
|
|
|
|
;
|
|
<BR> class_expr :
|
|
<B>iterator -> Parsetree.class_expr -> unit</B>
|
|
|
|
;
|
|
<BR> class_field :
|
|
<B>iterator -> Parsetree.class_field -> unit</B>
|
|
|
|
;
|
|
<BR> class_signature :
|
|
<B>iterator -> Parsetree.class_signature -> unit</B>
|
|
|
|
;
|
|
<BR> class_structure :
|
|
<B>iterator -> Parsetree.class_structure -> unit</B>
|
|
|
|
;
|
|
<BR> class_type :
|
|
<B>iterator -> Parsetree.class_type -> unit</B>
|
|
|
|
;
|
|
<BR> class_type_declaration :
|
|
<B>iterator -> Parsetree.class_type_declaration -> unit</B>
|
|
|
|
;
|
|
<BR> class_type_field :
|
|
<B>iterator -> Parsetree.class_type_field -> unit</B>
|
|
|
|
;
|
|
<BR> constructor_declaration :
|
|
<B>iterator -> Parsetree.constructor_declaration -> unit</B>
|
|
|
|
;
|
|
<BR> expr :
|
|
<B>iterator -> Parsetree.expression -> unit</B>
|
|
|
|
;
|
|
<BR> extension :
|
|
<B>iterator -> Parsetree.extension -> unit</B>
|
|
|
|
;
|
|
<BR> extension_constructor :
|
|
<B>iterator -> Parsetree.extension_constructor -> unit</B>
|
|
|
|
;
|
|
<BR> include_declaration :
|
|
<B>iterator -> Parsetree.include_declaration -> unit</B>
|
|
|
|
;
|
|
<BR> include_description :
|
|
<B>iterator -> Parsetree.include_description -> unit</B>
|
|
|
|
;
|
|
<BR> label_declaration :
|
|
<B>iterator -> Parsetree.label_declaration -> unit</B>
|
|
|
|
;
|
|
<BR> location :
|
|
<B>iterator -> Location.t -> unit</B>
|
|
|
|
;
|
|
<BR> module_binding :
|
|
<B>iterator -> Parsetree.module_binding -> unit</B>
|
|
|
|
;
|
|
<BR> module_declaration :
|
|
<B>iterator -> Parsetree.module_declaration -> unit</B>
|
|
|
|
;
|
|
<BR> module_substitution :
|
|
<B>iterator -> Parsetree.module_substitution -> unit</B>
|
|
|
|
;
|
|
<BR> module_expr :
|
|
<B>iterator -> Parsetree.module_expr -> unit</B>
|
|
|
|
;
|
|
<BR> module_type :
|
|
<B>iterator -> Parsetree.module_type -> unit</B>
|
|
|
|
;
|
|
<BR> module_type_declaration :
|
|
<B>iterator -> Parsetree.module_type_declaration -> unit</B>
|
|
|
|
;
|
|
<BR> open_declaration :
|
|
<B>iterator -> Parsetree.open_declaration -> unit</B>
|
|
|
|
;
|
|
<BR> open_description :
|
|
<B>iterator -> Parsetree.open_description -> unit</B>
|
|
|
|
;
|
|
<BR> pat :
|
|
<B>iterator -> Parsetree.pattern -> unit</B>
|
|
|
|
;
|
|
<BR> payload :
|
|
<B>iterator -> Parsetree.payload -> unit</B>
|
|
|
|
;
|
|
<BR> signature :
|
|
<B>iterator -> Parsetree.signature -> unit</B>
|
|
|
|
;
|
|
<BR> signature_item :
|
|
<B>iterator -> Parsetree.signature_item -> unit</B>
|
|
|
|
;
|
|
<BR> structure :
|
|
<B>iterator -> Parsetree.structure -> unit</B>
|
|
|
|
;
|
|
<BR> structure_item :
|
|
<B>iterator -> Parsetree.structure_item -> unit</B>
|
|
|
|
;
|
|
<BR> typ :
|
|
<B>iterator -> Parsetree.core_type -> unit</B>
|
|
|
|
;
|
|
<BR> row_field :
|
|
<B>iterator -> Parsetree.row_field -> unit</B>
|
|
|
|
;
|
|
<BR> object_field :
|
|
<B>iterator -> Parsetree.object_field -> unit</B>
|
|
|
|
;
|
|
<BR> type_declaration :
|
|
<B>iterator -> Parsetree.type_declaration -> unit</B>
|
|
|
|
;
|
|
<BR> type_extension :
|
|
<B>iterator -> Parsetree.type_extension -> unit</B>
|
|
|
|
;
|
|
<BR> type_exception :
|
|
<B>iterator -> Parsetree.type_exception -> unit</B>
|
|
|
|
;
|
|
<BR> type_kind :
|
|
<B>iterator -> Parsetree.type_kind -> unit</B>
|
|
|
|
;
|
|
<BR> value_binding :
|
|
<B>iterator -> Parsetree.value_binding -> unit</B>
|
|
|
|
;
|
|
<BR> value_description :
|
|
<B>iterator -> Parsetree.value_description -> unit</B>
|
|
|
|
;
|
|
<BR> with_constraint :
|
|
<B>iterator -> Parsetree.with_constraint -> unit</B>
|
|
|
|
;
|
|
<BR> }
|
|
<P>
|
|
<P>
|
|
A
|
|
<B>iterator</B>
|
|
|
|
record implements one "method" 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 "do not do anything" mapping.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </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>
|