changeset 343 | 539b2e88f5b9 |
parent 261 | 24531cfaa36a |
child 363 | 0d6deecdb2eb |
--- a/progs/re1.scala Fri Oct 02 08:48:46 2015 +0100 +++ b/progs/re1.scala Fri Oct 02 23:44:14 2015 +0100 @@ -39,10 +39,10 @@ def matches(r: Rexp, s: String) : Boolean = nullable(ders(s.toList, r)) //example from the homework -//val r = STAR(ALT(SEQ(CHAR('a'), CHAR('b')), CHAR('b'))) -//der('a', r) -//der('b', r) -//der('c', r) +val r = STAR(ALT(SEQ(CHAR('a'), CHAR('b')), CHAR('b'))) +der('a', r) +der('b', r) +der('c', r) //optional: one or zero times def OPT(r: Rexp) = ALT(r, EMPTY)