app6.scala
changeset 92 e85600529ca5
parent 91 47f86885d481
child 93 4794759139ea
--- a/app6.scala	Sun Dec 23 00:38:56 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-def deriv (r: Rexp, c: Char) : Rexp = r match {
-  case NULL => NULL
-  case EMPTY => NULL
-  case CHAR(d) => if (c == d) EMPTY else NULL
-  case ALT(r1, r2) => ALT(deriv(r1, c), deriv(r2, c))
-  case SEQ(r1, r2) => 
-    if (nullable(r1)) ALT(SEQ(deriv(r1, c), r2), deriv(r2, c))
-    else SEQ(deriv(r1, c), r2)
-  case STAR(r) => SEQ(deriv(r, c), STAR(r))
-}
-