# HG changeset patch # User cu # Date 1507070116 -3600 # Node ID 7b9a0782a8048358ca305639071f81bdf5615132 # Parent 56550ad904d8fd10635350faa7fba2328a8c4fb7 updated diff -r 56550ad904d8 -r 7b9a0782a804 progs/re1.scala --- 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 { diff -r 56550ad904d8 -r 7b9a0782a804 progs/re2.scala --- a/progs/re2.scala Tue Oct 03 23:01:06 2017 +0100 +++ b/progs/re2.scala Tue Oct 03 23:35:16 2017 +0100 @@ -1,6 +1,6 @@ -// Version with explicit an explicit n-times regular expression; -// this keeps the overall regular expression in the EVIL1 regular -// expression small +// Version with an explicit n-times regular expression; +// this keeps the size of the regular expression in the +// EVIL1 test-case quite small abstract class Rexp case object ZERO extends Rexp