diff options
-rw-r--r-- | src/semantic/ir.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/semantic/ir.rs b/src/semantic/ir.rs new file mode 100644 index 0000000..deeed96 --- /dev/null +++ b/src/semantic/ir.rs @@ -0,0 +1,23 @@ +use super::temp; + +pub enum Binop { + Plus, +} + +pub enum Expression { + Const(u64), + Name(temp::TempLabel), + Temp(temp::TempName), + Binop(Binop, Box<Expression>, Box<Expression>), + Memory(Box<Expression>), + Call(Box<Expression>, Vec<Expression>), + Seq(Vec<Statement>, Box<Expression>), +} + +pub enum Statement { + Exp(Expression), + MoveTemp(temp::TempName, Expression), + MoveMem(Expression, Expression), + Seq(Box<Statement>, Box<Statement>), + Label(temp::TempLabel), +} |