changeset 852 | 8706b846a3e0 |
parent 850 | ea320c9427d2 |
child 896 | b7a6436c7758 |
851:48539905c447 | 852:8706b846a3e0 |
---|---|
11 // a sequence. |
11 // a sequence. |
12 |
12 |
13 type IsSeq[A] = A => Seq[_] |
13 type IsSeq[A] = A => Seq[_] |
14 |
14 |
15 abstract class Parser[I : IsSeq, T]{ |
15 abstract class Parser[I : IsSeq, T]{ |
16 def parse(in: I): Set[(T, I)] |
16 def parse(in: I): Set[(T, I)] |
17 |
17 |
18 def parse_all(in: I) : Set[T] = |
18 def parse_all(in: I) : Set[T] = |
19 for ((hd, tl) <- parse(in); |
19 for ((hd, tl) <- parse(in); |
20 if tl.isEmpty) yield hd |
20 if tl.isEmpty) yield hd |
21 } |
21 } |