| changeset 523 | 9c3db5a99084 |
| parent 519 | 3921e68f5cd1 |
| child 544 | 91926c861910 |
--- a/progs/re3.scala Wed Oct 18 11:02:44 2017 +0100 +++ b/progs/re3.scala Wed Oct 18 12:33:00 2017 +0100 @@ -11,6 +11,12 @@ case class SEQ(r1: Rexp, r2: Rexp) extends Rexp case class STAR(r: Rexp) extends Rexp case class NTIMES(r: Rexp, n: Int) extends Rexp +case class CSET(cs: Set[Char]) extends Rexp +case class CFUN(f: Char => Bool) extends Rexp + +CSET(('a' to 'z').toSet) + +val CSET2(cs: Set[Char]) = CFUN((c:Char) => cs.contains(c)) // nullable function: tests whether the regular