Simple structure
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
pub mod parser;
|
||||||
|
pub mod runtime;
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
pub struct Program {
|
||||||
|
pub functions: Vec<Function>,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Function {
|
||||||
|
pub name: String,
|
||||||
|
pub params: Vec<String>,
|
||||||
|
pub body: Vec<Instruction>,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Instruction {
|
||||||
|
pub opcode: String,
|
||||||
|
pub operands: Vec<Operand>,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub enum Operand {
|
||||||
|
Global(String),
|
||||||
|
Local(String),
|
||||||
|
Number(i64),
|
||||||
|
Pointer(Box<Operand>),
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
pub mod ast;
|
||||||
Reference in New Issue
Block a user