equal
deleted
inserted
replaced
47 } |
47 } |
48 |
48 |
49 // main matcher function |
49 // main matcher function |
50 def matcher(r: Rexp, s: String) : Boolean = nullable(ders(s.toList, r)) |
50 def matcher(r: Rexp, s: String) : Boolean = nullable(ders(s.toList, r)) |
51 |
51 |
|
52 //example |
|
53 //val r = STAR(ALT(SEQ(CHAR('a'), CHAR('b')), CHAR('b'))) |
|
54 //der('b', r) |
|
55 //der('b', r) |
52 |
56 |
53 //one or zero |
57 //one or zero |
54 def OPT(r: Rexp) = ALT(r, EMPTY) |
58 def OPT(r: Rexp) = ALT(r, EMPTY) |
55 |
59 |
56 //n-times |
60 //n-times |