equal
deleted
inserted
replaced
152 def compile_decl(d: Decl) : String = d match { |
152 def compile_decl(d: Decl) : String = d match { |
153 case Def(name, args, a) => { |
153 case Def(name, args, a) => { |
154 val env = args.zipWithIndex.toMap |
154 val env = args.zipWithIndex.toMap |
155 val is = "I" * args.length |
155 val is = "I" * args.length |
156 m".method public static $name($is)I" ++ |
156 m".method public static $name($is)I" ++ |
157 m".limit locals ${args.length.toString}" ++ |
157 m".limit locals ${args.length}" ++ |
158 m".limit stack ${1 + max_stack_exp(a)}" ++ |
158 m".limit stack ${1 + max_stack_exp(a)}" ++ |
159 l"${name}_Start" ++ |
159 l"${name}_Start" ++ |
160 compile_exp(a, env) ++ |
160 compile_exp(a, env) ++ |
161 i"ireturn" ++ |
161 i"ireturn" ++ |
162 m".end method\n" |
162 m".end method\n" |