progs/app7.scala
author Christian Urban <urbanc@in.tum.de>
Mon, 22 Aug 2016 09:14:22 +0200
changeset 413 b7221df9662a
parent 295 19f23c4c2167
permissions -rw-r--r--
removed

abstract class Parser[I, T] {
  def parse(ts: I): Set[(T, I)]

  def parse_all(ts: I) : Set[T] =
    for ((head, tail) <- parse(ts); 
         if (tail.isEmpty)) yield head
}