changeset 295 | 19f23c4c2167 |
parent 169 | 57df3d7b4a25 |
294:c29853b672fb | 295:19f23c4c2167 |
---|---|
1 abstract class Parser[I, T] { |
1 abstract class Parser[I, T] { |
2 def parse(ts: I): Set[(T, I)] |
2 def parse(ts: I): Set[(T, I)] |
3 |
3 |
4 def parse_all(ts: I) : Set[T] = |
4 def parse_all(ts: I) : Set[T] = |
5 for ((head, tail) <- parse(ts); if (tail.isEmpty)) |
5 for ((head, tail) <- parse(ts); |
6 yield head |
6 if (tail.isEmpty)) yield head |
7 } |
7 } |
8 |
8 |
9 |
9 |