progs/re3.scala
changeset 517 edab48a5b37e
parent 477 b78664a24f5d
child 519 955d5b3b0619
equal deleted inserted replaced
516:ff643cbb7142 517:edab48a5b37e
     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