updated
authorChristian Urban <urbanc@in.tum.de>
Wed, 19 Oct 2016 08:46:50 +0100
changeset 457 921fdd17d2b8
parent 456 2fddf8ab744f
child 458 896a5f91838d
updated
progs/re3a.scala
--- a/progs/re3a.scala	Tue Oct 18 20:39:54 2016 +0100
+++ b/progs/re3a.scala	Wed Oct 19 08:46:50 2016 +0100
@@ -35,7 +35,7 @@
   case NTIMES(r1, i) => 
     if (i == 0) ZERO else
     if (nullable(r1)) SEQ(der(c, r1), UPNTIMES(r1, i - 1))
-    else SEQ(der(c, r1), NTIMES(r1, i))
+    else SEQ(der(c, r1), NTIMES(r1, i - 1))
   case UPNTIMES(r1, i) => 
     if (i == 0) ZERO
     else SEQ(der(c, r1), UPNTIMES(r1, i - 1)) 
@@ -68,7 +68,6 @@
 // main matcher function
 def matcher(r: Rexp, s: String) : Boolean = nullable(ders(s.toList, r))
 
-
 //one or zero
 def OPT(r: Rexp) = ALT(r, ONE)