add bytecode
This commit is contained in:
parent
76cf35e72e
commit
0e60dbb3b2
40
src/bytecode.rs
Normal file
40
src/bytecode.rs
Normal file
@ -0,0 +1,40 @@
|
||||
#[derive(Debug)]
|
||||
pub enum Instructions {
|
||||
Duplicate,
|
||||
Pop,
|
||||
|
||||
Jump(usize),
|
||||
JumpIf(usize),
|
||||
|
||||
Reserve(usize),
|
||||
Load(usize),
|
||||
Store(usize),
|
||||
|
||||
PushUnit,
|
||||
PushInt(i64),
|
||||
PushFloat(i64),
|
||||
PushString(String),
|
||||
PushBool(bool),
|
||||
|
||||
Not,
|
||||
Negate,
|
||||
Reference,
|
||||
Dereference,
|
||||
|
||||
Add,
|
||||
Subtract,
|
||||
Multiply,
|
||||
Divide,
|
||||
Modulo,
|
||||
Exponentiate,
|
||||
LT,
|
||||
LTE,
|
||||
GT,
|
||||
GTE,
|
||||
Equal,
|
||||
Inequal,
|
||||
And,
|
||||
Or,
|
||||
In,
|
||||
NotIn,
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
mod ast;
|
||||
mod bytecode;
|
||||
mod compiler;
|
||||
mod lexer;
|
||||
mod parser;
|
||||
mod tokens;
|
||||
|
Loading…
Reference in New Issue
Block a user