LARA

package whilelang
 
/** For all programs listed in Programs; prints the code, interprets, simplifies, prints again and re-interprets. */
object Main {
  def main(args : Array[String]) : Unit = {
    Programs.programs.foreach(prog => {
      val (name, code) = prog
      println("*-*-*-*-*")
      println("Start of: " + name)
      println
      TreePrinter(code)
      println
      Interpreter(code)
 
      val transformed: Statement = TreeSimplifier(code)
      println
      TreePrinter(transformed)
      println
      Interpreter(transformed)
 
      println("End of: " + name)
    })
    println("*-*-*-*-*")
    println("All done.")
  }
}