add bytecode

This commit is contained in:
SimonFJ20 2023-03-16 16:24:17 +01:00
parent 76cf35e72e
commit 0e60dbb3b2
2 changed files with 42 additions and 0 deletions

40
src/bytecode.rs Normal file
View 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,
}

View File

@ -1,6 +1,8 @@
#![allow(dead_code)]
mod ast;
mod bytecode;
mod compiler;
mod lexer;
mod parser;
mod tokens;