uhc-light-1.1.8.5: 103/lib/ag/CoreRun/AbsSyn.ag
DATA Mod
| Mod ref2nm : {Ref2Nm} -- inverse lookup of locally introduced binding RRef's
moduleNm : {HsName}
moduleNr : {Int} -- sequence nr, index later into global table of modules
stkDepth : {Int} -- max depth of stack for setting up globals
metas : MetaL
binds : {CRArray Bind}
body : Exp
DATA Meta
| Data tyNm : {HsName}
dataCons : DataConL
TYPE MetaL = [Meta]
SET AllMeta = Meta MetaL
-- Equivalent of data type def holding the minimal pieces of info required for codegen
DATA DataCon
| Con conNm : {HsName}
tagNr : {Int} -- runtime tag
-- arity : {Int} -- nr of fields, excluding tag
TYPE DataConL = [DataCon]
SET AllDataCon = DataCon DataConL
SET AllMetaNT = AllMeta AllDataCon
DATA SExp
-- base cases
| Var ref : {RRef}
| Int int : {Int}
| Char char : {Char}
| String str : {String}
| Integer integer : {Integer}
-- Debug only
| Dbg msg : {String}
DATA Exp
-- base cases
| SExp sexpr : SExp
-- node constructor, tuple or data constructor, determined by tag
| Tup tag : {Int}
args : {CRArray SExp}
-- let bindings, recursiveness allowed, yes/no eval made explicit in rhs of binding
| Let -- lev : {Int}
firstOff : {Int} -- offset of first binding
ref2nm : {Ref2Nm} -- inverse lookup of locally introduced binding RRef's
binds : {CRArray Bind}
body : Exp
-- application, abstraction
| App -- isTailRec : {Bool}
func : Exp
args : {CRArray SExp}
| Lam mbNm : {Maybe HsName} -- possibly bound to name
-- lev : {Int} -- lexical level
nrArgs : {Int} -- nr of arguments, 0 means it is a thunk
-- nrBinds : {Int} -- nr stack frame locations to be allocated (excluding arguments) for locals
stkDepth : {Int} -- max depth of stack
ref2nm : {Ref2Nm} -- inverse lookup of locally introduced binding RRef's
body : Exp
-- thunking, forcing, partial applications
| Force expr : Exp
-- | Thunk expr : Exp -- expressed as parameterless Lam
-- expr in a context to which must be returned (i.e. no tail rec)
-- | Ret expr : Exp
-- expr in a case alternative result context (with local bindings to be removed)
-- | RetCase nrBinds : {Int}
-- expr : Exp
-- Tail context
| Tail expr : Exp
-- case
| Case expr : SExp
alts : {CRArray Alt}
-- FFI call
| FFI prim : {RunPrim}
args : {CRArray SExp}
{-
| FFI callconv : {FFIWay}
impEnt : {ForeignEnt}
ty : {Ty}
args : {CRArray Exp}
-}
DATA Alt
| Alt ref2nm : {Ref2Nm} -- inverse lookup of locally introduced binding RRef's
-- pat : Pat
expr : Exp
DATA Pat
| Con tag : {Int}
| BoolExpr expr : Exp
SET AllNT
= Mod SExp Exp Alt Pat