Language.SSVM.Types
- type DArray = Array Int StackItem
- data StackItem
- showType :: StackItem -> String
- showItem :: StackItem -> String
- showPrint :: StackItem -> String
- showCode :: Code -> String
- type Stack = [StackItem]
- type Marks = Map String Int
- showMarks :: Marks -> String
- data Code = Code {}
- class (Data a, Typeable a) => StackType a where
- data Instruction
- data Definition = Definition Int Stack
- data VMState = VMState {}
- emptyVMState :: VMState
- type VM a = StateT VMState IO a
Documentation
Stack item
Constructors
SInteger Integer | |
SString String | |
SInstruction Instruction | |
SArray DArray | |
Quote StackItem |
VM code
data Instruction Source
VM instructions
Constructors
NOP | Do nothing |
PUSH StackItem | |
DROP | |
DUP | |
SWAP | |
OVER | |
PRINTALL | |
ADD | |
MUL | |
DIV | |
REM | |
SUB | |
NEG | |
ABS | |
CMP | |
DEFINE | |
COLON | |
CALL String | Call named user-defined word |
VARIABLE | |
ASSIGN | |
READ | |
INPUT | |
MARK | |
GETMARK String | |
GOTO | |
JZ | |
JNZ | |
JGT | |
JLT | |
JGE | |
JLE | |
ARRAY | |
READ_ARRAY | |
ASSIGN_ARRAY |
Instances
VM state
Constructors
VMState | |
Fields
|
Starting VM state