-
dynlink
-
ocamlbytecomp
-
ocamlcommon
-
ocamlmiddleend
-
ocamloptcomp
-
odoc_info
-
stdlib
-
str
-
unix
Library
Module
Module type
Parameter
Class
Class type
type constant =
| Pconst_integer of string * char option | (* Integer constants such as Suffixes |
| Pconst_char of char | (* Character such as |
| Pconst_string of string * Location.t * string option | (* Constant string such as The location span the content of the string, without the delimiters. *) |
| Pconst_float of string * char option | (* Float constant such as Suffixes |
type location_stack = Location.t list
Extension points
Attributes such as [\@id ARG]
and [\@\@id ARG]
.
Metadata containers passed around within the AST. The compiler ignores unknown attributes.
and extension = string Asttypes.loc * payload
Extension points such as [%id ARG] and [%%id ARG]
.
Sub-language placeholder -- rejected by the typechecker.
and attributes = attribute list
and payload =
| PStr of structure | |
| PSig of signature | (*
|
| PTyp of core_type | (*
|
| PPat of pattern * expression option | (*
|
Core language
Type expressions
and core_type = {
ptyp_desc : core_type_desc; | |
ptyp_loc : Location.t; | |
ptyp_loc_stack : location_stack; | |
ptyp_attributes : attributes; | (*
|
}
and core_type_desc =
| Ptyp_any | (*
|
| Ptyp_var of string | (* A type variable such as |
| Ptyp_arrow of Asttypes.arg_label * core_type * core_type | (*
|
| Ptyp_tuple of core_type list | (*
Invariant: |
| Ptyp_constr of Longident.t Asttypes.loc * core_type list | (*
|
| Ptyp_object of object_field list * Asttypes.closed_flag | (*
|
| Ptyp_class of Longident.t Asttypes.loc * core_type list | (*
|
| Ptyp_alias of core_type * string | (*
|
| Ptyp_variant of row_field list
* Asttypes.closed_flag
* Asttypes.label list option | (*
|
| Ptyp_poly of string Asttypes.loc list * core_type | (*
Can only appear in the following context:
|
| Ptyp_package of package_type | (*
|
| Ptyp_extension of extension | (*
|
and package_type =
Longident.t Asttypes.loc * (Longident.t Asttypes.loc * core_type) list
As package_type
typed values:
(S, [])
represents(module S)
,(S, [(t1, T1) ; ... ; (tn, Tn)])
represents(module S with type t1 = T1 and ... and tn = Tn)
.
and row_field_desc =
| Rtag of Asttypes.label Asttypes.loc * bool * core_type list | (*
|
| Rinherit of core_type | (*
|
Patterns
and pattern = {
ppat_desc : pattern_desc; | |
ppat_loc : Location.t; | |
ppat_loc_stack : location_stack; | |
ppat_attributes : attributes; | (*
|
}
and pattern_desc =
| Ppat_any | (* The pattern |
| Ppat_var of string Asttypes.loc | (* A variable pattern such as |
| Ppat_alias of pattern * string Asttypes.loc | (* An alias pattern such as |
| Ppat_constant of constant | (* Patterns such as |
| Ppat_interval of constant * constant | (* Patterns such as Other forms of interval are recognized by the parser but rejected by the type-checker. *) |
| Ppat_tuple of pattern list | (* Patterns Invariant: |
| Ppat_construct of Longident.t Asttypes.loc
* (string Asttypes.loc list * pattern) option | (*
|
| Ppat_variant of Asttypes.label * pattern option | (*
|
| Ppat_record of (Longident.t Asttypes.loc * pattern) list * Asttypes.closed_flag | (*
Invariant: |
| Ppat_array of pattern list | (* Pattern |
| Ppat_or of |