while.scala
changeset 85 1a4065f965fb
parent 74 8f85d1f61663
--- a/while.scala	Wed Nov 28 08:28:26 2012 +0000
+++ b/while.scala	Mon Dec 03 15:35:27 2012 +0000
@@ -1,7 +1,8 @@
 // A parser and evaluator for teh while language
 // 
-//:load matcher.scala
-//:load parser3.scala
+import matcher._
+import parser._
+
 
 // some regular expressions
 val SYM = RANGE("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz_")
@@ -30,7 +31,7 @@
 case class T_NUM(s: String) extends Token
 case class T_KWD(s: String) extends Token
 
-val lexing_rules: List[Rule[Token]] = 
+val lexing_rules: List[(Rexp, List[Char] => Token)] = 
   List((KEYWORD, (s) => T_KWD(s.mkString)),
        (ID, (s) => T_ID(s.mkString)),
        (OP, (s) => T_OP(s.mkString)),