--- a/progs/re1.scala Tue Oct 03 23:01:06 2017 +0100
+++ b/progs/re1.scala Tue Oct 03 23:35:16 2017 +0100
@@ -1,7 +1,5 @@
// Simple matcher for basic regular expressions
-object Test {
-
abstract class Rexp
case object ZERO extends Rexp // matches nothing
case object ONE extends Rexp // matches the empty string
@@ -19,10 +17,9 @@
case ALT(r1, r2) => nullable(r1) || nullable(r2)
case SEQ(r1, r2) => nullable(r1) && nullable(r2)
case STAR(_) => true
-
}
-}
+
// derivative of a regular expression w.r.t. a character
def der (c: Char, r: Rexp) : Rexp = r match {