progs/app51.scala
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Wed, 06 Apr 2016 11:51:33 +0100
changeset 399 5c1fbb39c93e
parent 261 24531cfaa36a
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))
}