progs/re3.scala
changeset 517 2ba868eb95cc
parent 477 28e872e7efb3
child 519 3921e68f5cd1
equal deleted inserted replaced
516:e4ed90b9948d 517:2ba868eb95cc
     1 // Version with simplification during derivatives;
     1 // Version with simplification during derivatives;
     2 // this keeps the regular expressions small, which
     2 // this keeps the regular expressions small, which
     3 // is good for run-time
     3 // is good for run-time
       
     4  
     4 
     5 
     5 abstract class Rexp
     6 abstract class Rexp
     6 case object ZERO extends Rexp
     7 case object ZERO extends Rexp
     7 case object ONE extends Rexp
     8 case object ONE extends Rexp
     8 case class CHAR(c: Char) extends Rexp
     9 case class CHAR(c: Char) extends Rexp