11 lines
295 B
Haskell
11 lines
295 B
Haskell
module AST where
|
|
|
|
-- A variable in a function, like 'x' or 'y'
|
|
newtype Variable = Var String
|
|
|
|
-- The instructions in out IJVM AST
|
|
data Instruction = IADD | ISUB | IMUL | IDIV | IEXP | INEG | BIPUSH Int | ILOAD Variable
|
|
|
|
-- The program is just a list of instructions
|
|
type Program = [Instruction]
|