solutions/cw4/compiler.sc
changeset 905 15973df32613
parent 894 02ef5c3abc51
child 910 b655ce68983f
equal deleted inserted replaced
904:d97283992d4f 905:15973df32613
   246   n := n - 1
   246   n := n - 1
   247 };
   247 };
   248 write "Result";
   248 write "Result";
   249 write minus2"""
   249 write minus2"""
   250 
   250 
   251 //compile_all(Stmts.parse_all(tokenise(fibonacciProgram)).head, "fib")
   251 compile_all(Stmts.parse_all(tokenise(fibonacciProgram)).head, "fib")
   252 
   252 
   253 val factorialProgram = """write "Factorial";
   253 val factorialProgram = """write "Factorial";
   254 read n;
   254 read n;
   255 fact := 1;
   255 fact := 1;
   256 
   256