# HG changeset patch # User cu # Date 1507070116 -3600 # Node ID 676e6484f29bc65779667376fc00707ac83d15aa # Parent a6aa52ecc1c58931c0030c2b315a61fd8d60ee14 updated diff -r a6aa52ecc1c5 -r 676e6484f29b 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 a6aa52ecc1c5 -r 676e6484f29b 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