Commit 7dc329dd authored by Daan Sprenkels's avatar Daan Sprenkels
Browse files

codegen: stub for Exp::to_ssm_code

parent ec1c3960
Pipeline #1654 passed with stage
......@@ -419,7 +419,7 @@ impl ToSSMCode for WhileStmt {
// TEST condition
// BEQ (ie: condition holds) to label of this loop
// BNE (ie: condition doesn't hold) out of the loop
// label this while loop, whilecounter?
output.push(SSMLine::SSMLabel(String::from("whilestmt")));
......@@ -586,7 +586,19 @@ impl Exp {
impl ToSSMCode for Exp {
fn to_ssm_code(&self) -> Vec<SSMLine> {
let mut output: Vec<SSMLine> = Vec::new();
output.append(&mut self.to_ssm_code());
match *self {
Exp::Op1(ref x) => output.append(&mut x.to_ssm_code()),
Exp::Op2(ref x) => output.append(&mut x.to_ssm_code()),
Exp::Field(ref x) => unimplemented!(),
Exp::FunCall(ref x) => output.append(&mut x.to_ssm_code()),
Exp::Ident(ref x) => unimplemented!(),
Exp::Int(ref x) => unimplemented!(),
Exp::Char(ref x) => unimplemented!(),
Exp::Bool(ref x) => unimplemented!(),
Exp::Pair(ref x) => output.append(&mut x.to_ssm_code()),
Exp::Paren(ref x) => output.append(&mut x.to_ssm_code()),
Exp::EmptyList(ref x) => unimplemented!(),
};
output
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment