progs/app51.scala
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Mon, 17 Nov 2014 08:38:52 +0000
changeset 308 3703ade9b17c
parent 261 24531cfaa36a
child 399 5c1fbb39c93e
permissions -rw-r--r--
updated

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

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