Attic/rev.scala
changeset 742 b5b5583a3a08
parent 408 5322e1c46890
equal deleted inserted replaced
741:e66bd5c563eb 742:b5b5583a3a08
       
     1 def rev(r: Rexp) : Rexp = r match {
       
     2   case ZERO => ZERO
       
     3   case ONE => ONE
       
     4   case CHAR(c) => CHAR(c)
       
     5   case ALT(r1, r2) => ALT(rev(r1), rev(r2))
       
     6   case SEQ(r1, r2) => SEQ(rev(r2), rev(r1))
       
     7   case STAR(r) => STAR(rev(r))
       
     8 }