progs/app51.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Sun, 15 Nov 2020 00:33:16 +0000
changeset 804 387240957c3d
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))
}