progs/matcher/re3.sc
changeset 882 5fcad75ade92
parent 879 ad9d4a01e072
child 919 53f08d873e09
equal deleted inserted replaced
881:3b2f76950473 882:5fcad75ade92
    61     case (r1s, ONE) => r1s
    61     case (r1s, ONE) => r1s
    62     case (r1s, r2s) => SEQ(r1s, r2s)
    62     case (r1s, r2s) => SEQ(r1s, r2s)
    63   }
    63   }
    64   case r => r
    64   case r => r
    65 }
    65 }
       
    66 
    66 
    67 
    67 
    68 
    68 // the derivative w.r.t. a string (iterates der)
    69 // the derivative w.r.t. a string (iterates der)
    69 def ders(s: List[Char], r: Rexp) : Rexp = s match {
    70 def ders(s: List[Char], r: Rexp) : Rexp = s match {
    70   case Nil => r
    71   case Nil => r