epic

Epic.Stackcode

# Documentation

type Loc = Int

type Tmp = Int

data ByteOp

Constructors

EVAL Loc Bool |
PUSH Loc |
INT Int |
BIGINT Integer |
FLOAT Double |
STRING Int |
CON Tag Int |
UNIT |
UNUSED |
THUNK Int Int Name |
CALL Name |
SLIDE Int Int |
DISCARD Int |
ADDARGS Loc Int |
PROJ Int Int |
CASE [(Int, Bytecode)] (Maybe Bytecode) |
INTCASE [(Int, Bytecode)] (Maybe Bytecode) |
IF Bytecode Bytecode |
MEMORY Allocator Bytecode |
WHILE Bytecode Bytecode |
BREAKFALSE |
OP Op Loc Loc |
CONSTS [String] |
FOREIGN Type String [Type] |
NotImplemented String |

Instances

Show ByteOp |

type Bytecode = [ByteOp]

data FunCode

Constructors

Code Bytecode |

Instances

Show FunCode |

data CompileState

Constructors

CS |

Fields

num_locals :: Int
string_pool :: [String]

compile :: Context -> Name -> Func -> FunCode

data TailCall

Constructors

Tail |
Middle |

scompile :: Context -> Name -> Func -> State CompileState Bytecode