Module Ast.Ast_types
module type ID = sig ... end
An abstract type for identifiers
module Class_name : ID
module Capability_name : ID
module Field_name : ID
module Method_name : ID
module Function_name : ID
type mode
=
Define modes for data references
type type_expr
=
|
TEInt
|
TEClass of Class_name.t * type_expr option
optionally specify type parameters - for generic classes
|
TEVoid
|
TEBool
|
TEGeneric
Define types of expressions in Bolt programs
type field_defn
=
|
TField of modifier * type_expr * Field_name.t * Capability_name.t list
Class Field declarations are of the form "modifier type name : capabilities" e.g. const int f : cap_1
type capability
=
|
TCapability of mode * Capability_name.t
Capabilities consist of a mode and a name
type param
=
|
TParam of type_expr * Var_name.t * Capability_name.t list option * borrowed_ref option
Parameter of a function can optionally restrict capabilities used, and may be "borrowed".
type bin_op
=
|
BinOpPlus
|
BinOpMinus
|
BinOpMult
|
BinOpIntDiv
|
BinOpRem
|
BinOpLessThan
|
BinOpLessThanEq
|
BinOpGreaterThan
|
BinOpGreaterThanEq
|
BinOpAnd
|
BinOpOr
|
BinOpEq
|
BinOpNotEq
type un_op
=
|
UnOpNot
|
UnOpNeg
val string_of_loc : loc -> string
val string_of_mode : mode -> string
val string_of_cap : capability -> string
val string_of_modifier : modifier -> string
val string_of_type : type_expr -> string
val string_of_bin_op : bin_op -> string
val string_of_un_op : un_op -> string
val string_of_maybe_borrowed_ref : borrowed_ref option -> string
val string_of_maybe_generic : generic_type option -> string
val string_of_maybe_superclass : Class_name.t option -> string