progs/token.scala
changeset 617 f7de0915fff2
parent 581 19de761b69e9
child 624 8d0af38389bc
equal deleted inserted replaced
616:24bbe4e4b37b 617:f7de0915fff2
   289   print(i.toString + ":  ")
   289   print(i.toString + ":  ")
   290   time(lexing_simp(WHILE_REGS, prog2 * i))
   290   time(lexing_simp(WHILE_REGS, prog2 * i))
   291 }
   291 }
   292 
   292 
   293 
   293 
       
   294 val fib = """
       
   295 write "Fib";
       
   296 read n;
       
   297 minus1 := 0;
       
   298 minus2 := 1;
       
   299 while n > 0 do {
       
   300 temp := minus2;
       
   301 minus2 := minus1 + minus2;
       
   302 minus1 := temp;
       
   303 n := n - 1
       
   304 };
       
   305 write "Result";
       
   306 write minus2
       
   307 """
       
   308 
       
   309 println(env(lexing_simp(WHILE_REGS, prog2)).filterNot{_._1 == "w"})