Up
module
IL
:
sig
#
type
program = {
#
paramdefs
:
Stretch
.
t
list
;
#
prologue
:
Stretch
.
t
list
;
#
excdefs
:
excdef
list
;
#
typedefs
:
typedef
list
;
#
nonrecvaldefs
:
valdef
list
;
#
moduledefs
:
moduledef
list
;
#
valdefs
:
valdef
list
;
#
postlogue
: string list
;
}
#
type
interface =
interface_item
list
#
type
interface_item =
#
| IIFunctor
of
Stretch
.
t
list *
interface
#
| IIExcDecls
of
excdef
list
#
| IITypeDecls
of
typedef
list
#
| IIValDecls
of
(string *
typescheme
) list
#
| IIInclude
of
module_type
#
| IIModule
of
string *
module_type
#
| IIComment
of
string
#
type
module_type =
#
| MTNamedModuleType
of
string
#
| MTWithType
of
module_type
* string *
with_kind
*
typ
#
| MTSigEnd
of
interface
#
type
with_kind =
#
| WKNonDestructive
#
| WKDestructive
#
type
excdef = {
#
excname
: string
;
#
exceq
: string option
;
}
#
type
typedef = {
#
typename
: string
;
#
typeparams
: string list
;
#
typerhs
:
typedefrhs
;
#
typeconstraint
: (
typ
*
typ
) option
;
}
#
type
typedefrhs =
#
| TDefRecord
of
fielddef
list
#
| TDefSum
of
datadef
list
#
| TAbbrev
of
typ
#
type
fielddef = {
#
modifiable
: bool
;
#
fieldname
: string
;
#
fieldtype
:
typescheme
;
}
#
type
datadef = {
#
dataname
: string
;
#
datavalparams
:
typ
list
;
#
datatypeparams
:
typ
list option
;
}
#
type
typ =
#
| TypTextual
of
Stretch
.
ocamltype
#
| TypVar
of
string
#
| TypApp
of
string *
typ
list
#
| TypTuple
of
typ
list
#
| TypArrow
of
typ
*
typ
#
type
typescheme = {
#
quantifiers
: string list
;
#
body
:
typ
;
}
#
type
valdef = {
#
valpublic
: bool
;
#
valpat
:
pattern
;
#
valval
:
expr
;
}
#
type
expr =
#
| EVar
of
string
#
| EFun
of
pattern
list *
expr
#
| EApp
of
expr
*
expr
list
#
| ELet
of
(
pattern
*
expr
) list *
expr
#
| EMatch
of
expr
*
branch
list
#
| EIfThen
of
expr
*
expr
#
| EIfThenElse
of
expr
*
expr
*
expr
#
| ERaise
of
expr
#
| ETry
of
expr
*
branch
list
#
| EUnit
#
| EIntConst
of
int
#
| EMaxInt
#
| EStringConst
of
string
#
| EData
of
string *
expr
list
#
| ETuple
of
expr
list
#
| EAnnot
of
expr
*
typescheme
#
| EMagic
of
expr
#
| ERepr
of
expr
#
| ERecord
of
(string *
expr
) list
#
| ERecordAccess
of
expr
* string
#
| ERecordWrite
of
expr
* string *
expr
#
| ETextual
of
Stretch
.
t
#
| EComment
of
string *
expr
#
| EPatComment
of
string *
pattern
*
expr
#
| EArray
of
expr
list
#
| EArrayAccess
of
expr
*
expr
#
type
branch = {
#
branchpat
:
pattern
;
#
branchbody
:
expr
;
}
#
type
pattern =
#
| PWildcard
#
| PVar
of
string
#
| PUnit
#
| PData
of
string *
pattern
list
#
| PTuple
of
pattern
list
#
| PRecord
of
(string *
pattern
) list
#
| POr
of
pattern
list
#
| PAnnot
of
pattern
*
typ
#
type
directive =
#
| DirOpen
of
string
#
| DirInclude
of
string
#
type
moduledef = {
#
modulename
: string
;
#
modulerhs
:
modexpr
;
}
#
type
modexpr =
#
| MVar
of
string
#
| MStruct
of
structure
#
| MApp
of
modexpr
*
modexpr
#
type
structure = {
#
struct_excdefs
:
excdef
list
;
#
struct_typedefs
:
typedef
list
;
#
struct_nonrecvaldefs
:
valdef
list
;
}
end