equal
deleted
inserted
replaced
102 case Num(i) => i"ldc $i" |
102 case Num(i) => i"ldc $i" |
103 case Var(s) => i"iload ${env(s)} \t\t; $s" |
103 case Var(s) => i"iload ${env(s)} \t\t; $s" |
104 case Aop(op, a1, a2) => |
104 case Aop(op, a1, a2) => |
105 compile_aexp(a1, env) ++ compile_aexp(a2, env) ++ compile_op(op) |
105 compile_aexp(a1, env) ++ compile_aexp(a2, env) ++ compile_op(op) |
106 } |
106 } |
107 |
|
108 |
107 |
109 // boolean expression compilation |
108 // boolean expression compilation |
110 // - the jump-label is for where to jump if the condition is not true |
109 // - the jump-label is for where to jump if the condition is not true |
111 def compile_bexp(b: BExp, env : Env, jmp: String) : String = b match { |
110 def compile_bexp(b: BExp, env : Env, jmp: String) : String = b match { |
112 case True => "" |
111 case True => "" |