progs/while/compile.sc
changeset 815 f56d18757526
parent 812 2f9a0dcf61ae
child 816 2b6e23985982
equal deleted inserted replaced
814:1fbaa5f05516 815:f56d18757526
   215 
   215 
   216 def run(bl: Block, class_name: String) = {
   216 def run(bl: Block, class_name: String) = {
   217     val code = compile(bl, class_name)
   217     val code = compile(bl, class_name)
   218     os.write.over(os.pwd / s"$class_name.j", code)
   218     os.write.over(os.pwd / s"$class_name.j", code)
   219     os.proc("java", "-jar", "jasmin.jar", s"$class_name.j").call()
   219     os.proc("java", "-jar", "jasmin.jar", s"$class_name.j").call()
   220     print(os.proc("java", s"$class_name/$class_name").call().out.string)
   220     os.proc("java", s"$class_name/$class_name").call(stdout = os.Inherit, stdin = os.Inherit)
   221 }
   221 }
   222 
   222 
   223 @main
   223 @main
   224 def test2() =
   224 def test2() =
   225   run(fib_test, "fib")
   225   run(fib_test, "fib")