#[derive(Debug, PartialEq)] pub struct AbstractProgram { pub global_statements: Vec>, } #[derive(Debug, PartialEq)] pub enum GlobalStatement { FunctionDefinition { name: String, retval_dtype: Box, formal_args: Vec>, body: Box, }, } #[derive(Debug, PartialEq)] pub enum Dtype { Int, } #[derive(Debug, PartialEq)] pub struct FormalArg { pub name: String, pub dtype: Box, } #[derive(Debug, PartialEq)] pub enum LocalStatement { VariableDeclaration { name: String, dtype: Box, }, Evaluation { expression: Box, }, Block { statements: Vec>, }, If { condition: Box, true_branch: Box, }, IfElse { condition: Box, true_branch: Box, false_branch: Box, }, While { condition: Box, body: Box, }, } #[derive(Debug, PartialEq)] pub enum Expression { IntLiteral { value: i128, }, Variable { name: String, }, Assignment { lhs: Box, rhs: Box, }, } #[derive(Debug, PartialEq)] pub enum LValue { Variable { name: String }, }