progs/app51.scala
author cu
Wed, 25 Oct 2017 00:05:59 +0100
changeset 528 68fab15cd6fb
parent 399 5c1fbb39c93e
permissions -rw-r--r--
updated

def OPT(r: Rexp) = ALT(r, ONE)

def NTIMES(r: Rexp, n: Int) : Rexp = n match {
  case 0 => ONE
  case 1 => r
  case n => SEQ(r, NTIMES(r, n - 1))
}