progs/app51.scala
author Christian Urban <urbanc@in.tum.de>
Wed, 06 Nov 2019 23:17:05 +0000
changeset 683 c6c79d21f8a8
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))
}