diff --git a/src/bytecode.rs b/src/bytecode.rs new file mode 100644 index 0000000..65f9ccf --- /dev/null +++ b/src/bytecode.rs @@ -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, +} diff --git a/src/main.rs b/src/main.rs index 95bc199..d383b40 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,8 @@ #![allow(dead_code)] mod ast; +mod bytecode; +mod compiler; mod lexer; mod parser; mod tokens;