| SMLDoc |
structure Ast : AST =
struct
type srcpos = int
type region = srcpos * srcpos
type path = string list
type tyvar = string
type exp = unit
datatype fixity = INfix of int | INfixR of int | NONfix
datatype 'a sigConst = NoSig | Transparent of 'a | Opaque of 'a
datatype rule = Rule of {pat : pat, exp : exp}
datatype pat =
WildPat
| VarPat of path
| IntPat of int
| WordPat of int
| StringPat of string
| CharPat of string
| RecordPat of {def : (string * pat) list, flexibility : bool}
| ListPat of pat list
| TuplePat of pat list
| FlatAppPat of pat list
| ConstraintPat of {pattern : pat, constraint : ty}
| LayeredPat of {varPat : pat, expPat : pat}
| VectorPat of pat list
| MarkPat of pat * region
| OrPat of pat list
datatype strexp =
VarStr of path
| BaseStr of srcpos * dec
| ConstrainedStr of strexp * sigexp sigConst
| AppStr of path * (strexp * bool) list
| LetStr of srcpos * dec * strexp
| MarkStr of strexp * region
datatype fctexp =
VarFct of path * fsigexp sigConst
| BaseFct of
{
params : (string option * sigexp) list,
body : strexp,
constraint : sigexp sigConst
}
| LetFct of srcpos * dec * fctexp
| AppFct of path * (strexp * bool) list * fsigexp sigConst
| MarkFct of fctexp * region
datatype wherespec =
WhType of string list * tyvar list * srcpos * ty
| WhStruct of string list * string list
datatype sigexp =
VarSig of string
| AugSig of sigexp * wherespec list
| BaseSig of srcpos * (spec * srcpos) list
| MarkSig of sigexp * region
datatype fsigexp =
VarFsig of string
| BaseFsig of {params : (string option * sigexp) list, result : sigexp}
| MarkFsig of fsigexp * region
datatype spec =
StrSpec of (((string * sigexp * path option) * region) * srcpos) list
| TycSpec of
(((string * tyvar list * srcpos * ty option) * region) * srcpos) list *
bool
| FctSpec of (((string * fsigexp) * region) * srcpos) list
| ValSpec of (((string * srcpos * ty) * region) * srcpos) list
| DataSpec of
{
datatycs : (db * srcpos) list,
withtycsBeginPos : srcpos,
withtycs : (tb * srcpos) list
}
| ExceSpec of (((string * srcpos * ty option) * region) * srcpos) list
| ShareStrSpec of path list
| ShareTycSpec of path list
| IncludeSpec of sigexp
datatype dec =
ValDec of (vb * srcpos) list * tyvar list
| ValrecDec of (rvb * srcpos) list * tyvar list
| FunDec of (fb * srcpos) list * tyvar list
| TypeDec of (tb * srcpos) list
| DatatypeDec of
{
datatycs : (db * srcpos) list,
withtycsBeginPos : srcpos,
withtycs : (tb * srcpos) list
}
| AbstypeDec of
{
abstycs : (db * srcpos) list,
withtycsBeginPos : srcpos,
withtycs : (tb * srcpos) list,
bodyBeginPos : srcpos,
body : dec
}
| ExceptionDec of (eb * srcpos) list
| StrDec of (strb * srcpos) list
| AbsDec of (strb * srcpos) list
| FctDec of (fctb * srcpos) list
| SigDec of (sigb * srcpos) list
| FsigDec of (fsigb * srcpos) list
| LocalDec of srcpos * dec * srcpos * dec
| SeqDec of (dec * srcpos) list
| OpenDec of path list
| OvldDec of string * ty * exp list
| FixDec of {fixity : fixity, ops : string list}
| UseDec of string
| MarkDec of dec * region
datatype vb = Vb of {pat : pat, exp : exp, lazyp : bool} * region
datatype rvb =
Rvb of
{var : string, exp : exp, resultty : ty option, lazyp : bool} *
region
datatype fb = Fb of clause list * bool | MarkFb of fb * region
datatype clause =
Clause of {pats : pat list, resultty : ty option, exp : exp} * region
datatype tb =
Tb of
{tyc : string, defBeginPos : srcpos, def : ty, tyvars : tyvar list} *
region
datatype db =
Db of
{
tyc : string,
tyvars : tyvar list,
rhsBeginPos : srcpos,
rhs : dbrhs,
lazyp : bool
} *
region
datatype dbrhs =
Constrs of (((string * srcpos * ty option) * region) * srcpos) list
| Repl of string list
datatype eb =
EbGen of
{exn : string, etypeBeginPos : srcpos, etype : ty option} * region
| EbDef of {exn : string, edef : path} * region
datatype strb =
Strb of
{name : string, def : strexp, constraint : sigexp sigConst} * region
datatype fctb = Fctb of {name : string, def : fctexp} * region
datatype sigb = Sigb of {name : string, def : sigexp} * region
datatype fsigb = Fsigb of {name : string, def : fsigexp} * region
datatype ty =
VarTy of tyvar
| ConTy of string list * srcpos * (ty * srcpos) list
| RecordTy of srcpos * (tyrow * srcpos) list
| TupleTy of (ty * srcpos) list
| EnclosedTy of srcpos * ty
| MarkTy of ty * region
datatype tyrow = TyRow of (string * srcpos * ty) * region
end
Type detail |
---|
type srcpos = int
type tyvar = string
type exp = unit
Datatype detail |
---|
datatype fixity = INfix of int | INfixR of int | NONfix
datatype 'a sigConst = NoSig | Transparent of 'a | Opaque of 'a
datatype rule = Rule of {pat : pat, exp : exp}
datatype pat =
WildPat
| VarPat of path
| IntPat of int
| WordPat of int
| StringPat of string
| CharPat of string
| RecordPat of {def : (string * pat) list, flexibility : bool}
| ListPat of pat list
| TuplePat of pat list
| FlatAppPat of pat list
| ConstraintPat of {pattern : pat, constraint : ty}
| LayeredPat of {varPat : pat, expPat : pat}
| VectorPat of pat list
| MarkPat of pat * region
| OrPat of pat list
datatype strexp =
VarStr of path
| BaseStr of srcpos * dec
| ConstrainedStr of strexp * sigexp sigConst
| AppStr of path * (strexp * bool) list
| LetStr of srcpos * dec * strexp
| MarkStr of strexp * region
datatype fctexp =
VarFct of path * fsigexp sigConst
| BaseFct of
{
params : (string option * sigexp) list,
body : strexp,
constraint : sigexp sigConst
}
| LetFct of srcpos * dec * fctexp
| AppFct of path * (strexp * bool) list * fsigexp sigConst
| MarkFct of fctexp * region
datatype wherespec =
WhType of string list * tyvar list * srcpos * ty
| WhStruct of string list * string list
datatype sigexp =
VarSig of string
| AugSig of sigexp * wherespec list
| BaseSig of srcpos * (spec * srcpos) list
| MarkSig of sigexp * region
datatype fsigexp =
VarFsig of string
| BaseFsig of {params : (string option * sigexp) list, result : sigexp}
| MarkFsig of fsigexp * region
datatype spec =
StrSpec of (((string * sigexp * path option) * region) * srcpos) list
| TycSpec of
(((string * tyvar list * srcpos * ty option) * region) * srcpos) list *
bool
| FctSpec of (((string * fsigexp) * region) * srcpos) list
| ValSpec of (((string * srcpos * ty) * region) * srcpos) list
| DataSpec of
{
datatycs : (db * srcpos) list,
withtycsBeginPos : srcpos,
withtycs : (tb * srcpos) list
}
| ExceSpec of (((string * srcpos * ty option) * region) * srcpos) list
| ShareStrSpec of path list
| ShareTycSpec of path list
| IncludeSpec of sigexp
datatype dec =
ValDec of (vb * srcpos) list * tyvar list
| ValrecDec of (rvb * srcpos) list * tyvar list
| FunDec of (fb * srcpos) list * tyvar list
| TypeDec of (tb * srcpos) list
| DatatypeDec of
{
datatycs : (db * srcpos) list,
withtycsBeginPos : srcpos,
withtycs : (tb * srcpos) list
}
| AbstypeDec of
{
abstycs : (db * srcpos) list,
withtycsBeginPos : srcpos,
withtycs : (tb * srcpos) list,
bodyBeginPos : srcpos,
body : dec
}
| ExceptionDec of (eb * srcpos) list
| StrDec of (strb * srcpos) list
| AbsDec of (strb * srcpos) list
| FctDec of (fctb * srcpos) list
| SigDec of (sigb * srcpos) list
| FsigDec of (fsigb * srcpos) list
| LocalDec of srcpos * dec * srcpos * dec
| SeqDec of (dec * srcpos) list
| OpenDec of path list
| OvldDec of string * ty * exp list
| FixDec of {fixity : fixity, ops : string list}
| UseDec of string
| MarkDec of dec * region
datatype vb = Vb of {pat : pat, exp : exp, lazyp : bool} * region
datatype rvb =
Rvb of
{var : string, exp : exp, resultty : ty option, lazyp : bool} * region
datatype fb = Fb of clause list * bool | MarkFb of fb * region
datatype clause =
Clause of {pats : pat list, resultty : ty option, exp : exp} * region
datatype tb =
Tb of
{tyc : string, defBeginPos : srcpos, def : ty, tyvars : tyvar list} *
region
datatype db =
Db of
{
tyc : string,
tyvars : tyvar list,
rhsBeginPos : srcpos,
rhs : dbrhs,
lazyp : bool
} *
region
datatype dbrhs =
Constrs of (((string * srcpos * ty option) * region) * srcpos) list
| Repl of string list
datatype eb =
EbGen of
{exn : string, etypeBeginPos : srcpos, etype : ty option} * region
| EbDef of {exn : string, edef : path} * region
datatype strb =
Strb of
{name : string, def : strexp, constraint : sigexp sigConst} * region
datatype fctb = Fctb of {name : string, def : fctexp} * region
datatype sigb = Sigb of {name : string, def : sigexp} * region
datatype fsigb = Fsigb of {name : string, def : fsigexp} * region
datatype ty =
VarTy of tyvar
| ConTy of string list * srcpos * (ty * srcpos) list
| RecordTy of srcpos * (tyrow * srcpos) list
| TupleTy of (ty * srcpos) list
| EnclosedTy of srcpos * ty
| MarkTy of ty * region
datatype tyrow = TyRow of (string * srcpos * ty) * region
DataConstructor detail |
---|
constructor INfix : int -> fixity
constructor INfixR : int -> fixity
constructor NONfix : fixity
constructor NoSig : 'a sigConst
constructor Transparent : 'a -> 'a sigConst
constructor Opaque : 'a -> 'a sigConst
constructor Rule : {pat : pat, exp : exp} -> rule
constructor WildPat : pat
constructor VarPat : path -> pat
constructor IntPat : int -> pat
constructor WordPat : int -> pat
constructor StringPat : string -> pat
constructor CharPat : string -> pat
constructor RecordPat : {def : (string * pat) list, flexibility : bool} -> pat
constructor ListPat : pat list -> pat
constructor TuplePat : pat list -> pat
constructor FlatAppPat : pat list -> pat
constructor ConstraintPat : {pattern : pat, constraint : ty} -> pat
constructor LayeredPat : {varPat : pat, expPat : pat} -> pat
constructor VectorPat : pat list -> pat
constructor MarkPat : pat * region -> pat
constructor OrPat : pat list -> pat
constructor VarStr : path -> strexp
constructor BaseStr : srcpos * dec -> strexp
constructor ConstrainedStr : strexp * sigexp sigConst -> strexp
constructor AppStr : path * (strexp * bool) list -> strexp
constructor LetStr : srcpos * dec * strexp -> strexp
constructor MarkStr : strexp * region -> strexp
constructor VarFct : path * fsigexp sigConst -> fctexp
constructor BaseFct
: {
params : (string option * sigexp) list,
body : strexp,
constraint : sigexp sigConst
} ->
fctexp
constructor LetFct : srcpos * dec * fctexp -> fctexp
constructor AppFct : path * (strexp * bool) list * fsigexp sigConst -> fctexp
constructor MarkFct : fctexp * region -> fctexp
constructor WhType : string list * tyvar list * srcpos * ty -> wherespec
constructor WhStruct : string list * string list -> wherespec
constructor VarSig : string -> sigexp
constructor AugSig : sigexp * wherespec list -> sigexp
constructor BaseSig : srcpos * (spec * srcpos) list -> sigexp
constructor MarkSig : sigexp * region -> sigexp
constructor VarFsig : string -> fsigexp
constructor BaseFsig
: {params : (string option * sigexp) list, result : sigexp} ->
fsigexp
constructor MarkFsig : fsigexp * region -> fsigexp
constructor StrSpec
: (((string * sigexp * path option) * region) * srcpos) list -> spec
constructor TycSpec
: (((string * tyvar list * srcpos * ty option) * region) * srcpos) list *
bool ->
spec
constructor FctSpec : (((string * fsigexp) * region) * srcpos) list -> spec
constructor ValSpec : (((string * srcpos * ty) * region) * srcpos) list -> spec
constructor DataSpec
: {
datatycs : (db * srcpos) list,
withtycsBeginPos : srcpos,
withtycs : (tb * srcpos) list
} ->
spec
constructor ExceSpec
: (((string * srcpos * ty option) * region) * srcpos) list -> spec
constructor ShareStrSpec : path list -> spec
constructor ShareTycSpec : path list -> spec
constructor IncludeSpec : sigexp -> spec
constructor ValDec : (vb * srcpos) list * tyvar list -> dec
constructor ValrecDec : (rvb * srcpos) list * tyvar list -> dec
constructor FunDec : (fb * srcpos) list * tyvar list -> dec
constructor TypeDec : (tb * srcpos) list -> dec
constructor DatatypeDec
: {
datatycs : (db * srcpos) list,
withtycsBeginPos : srcpos,
withtycs : (tb * srcpos) list
} ->
dec
constructor AbstypeDec
: {
abstycs : (db * srcpos) list,
withtycsBeginPos : srcpos,
withtycs : (tb * srcpos) list,
bodyBeginPos : srcpos,
body : dec
} ->
dec
constructor ExceptionDec : (eb * srcpos) list -> dec
constructor StrDec : (strb * srcpos) list -> dec
constructor AbsDec : (strb * srcpos) list -> dec
constructor FctDec : (fctb * srcpos) list -> dec
constructor SigDec : (sigb * srcpos) list -> dec
constructor FsigDec : (fsigb * srcpos) list -> dec
constructor LocalDec : srcpos * dec * srcpos * dec -> dec
constructor SeqDec : (dec * srcpos) list -> dec
constructor OpenDec : path list -> dec
constructor OvldDec : string * ty * exp list -> dec
constructor FixDec : {fixity : fixity, ops : string list} -> dec
constructor UseDec : string -> dec
constructor MarkDec : dec * region -> dec
constructor Vb : {pat : pat, exp : exp, lazyp : bool} * region -> vb
constructor Rvb
: {var : string, exp : exp, resultty : ty option, lazyp : bool} *
region ->
rvb
constructor Fb : clause list * bool -> fb
constructor MarkFb : fb * region -> fb
constructor Clause
: {pats : pat list, resultty : ty option, exp : exp} * region ->
clause
constructor Tb
: {
tyc : string,
defBeginPos : srcpos,
def : ty,
tyvars : tyvar list
} *
region ->
tb
constructor Db
: {
tyc : string,
tyvars : tyvar list,
rhsBeginPos : srcpos,
rhs : dbrhs,
lazyp : bool
} *
region ->
db
constructor Constrs
: (((string * srcpos * ty option) * region) * srcpos) list -> dbrhs
constructor Repl : string list -> dbrhs
constructor EbGen
: {exn : string, etypeBeginPos : srcpos, etype : ty option} * region
->
eb
constructor EbDef : {exn : string, edef : path} * region -> eb
constructor Strb
: {name : string, def : strexp, constraint : sigexp sigConst} *
region ->
strb
constructor Fctb : {name : string, def : fctexp} * region -> fctb
constructor Sigb : {name : string, def : sigexp} * region -> sigb
constructor Fsigb : {name : string, def : fsigexp} * region -> fsigb
constructor VarTy : tyvar -> ty
constructor ConTy : string list * srcpos * (ty * srcpos) list -> ty
constructor RecordTy : srcpos * (tyrow * srcpos) list -> ty
constructor TupleTy : (ty * srcpos) list -> ty
constructor EnclosedTy : srcpos * ty -> ty
constructor MarkTy : ty * region -> ty
constructor TyRow : (string * srcpos * ty) * region -> tyrow
| SMLDoc: Documentation generator for SML |