Mercurial > hg > Members > shinya > pyrect
comparison pyrect/regexp/analyzer.py @ 73:a6a0504dea7b
modify bm-filter's implimentation. table-lookup -> switch. it's more simple and beautiful.
author | Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 08 Nov 2010 02:19:18 +0900 |
parents | 74f4e50c4f11 |
children | 8102bf4bbec6 |
comparison
equal
deleted
inserted
replaced
72:8b9c3a924744 | 73:a6a0504dea7b |
---|---|
21 (6, 3, []) | 21 (6, 3, []) |
22 >>> an.analyze(prs.parse('123(AB|CD)*456')) | 22 >>> an.analyze(prs.parse('123(AB|CD)*456')) |
23 (inf, 6, ['123', '456']) | 23 (inf, 6, ['123', '456']) |
24 >>> an.analyze(prs.parse('((12)+|3)|456')) | 24 >>> an.analyze(prs.parse('((12)+|3)|456')) |
25 (inf, 1, []) | 25 (inf, 1, []) |
26 >>> an.analyze(prs.parse('(plus)?(qmark)?')) | 26 >>> an.analyze(prs.parse('^(plus)?(qmark)?')) |
27 (9, 0, []) | 27 (9, 0, []) |
28 >>> an.analyze(prs.parse('\*+ \[\[')) | 28 >>> an.analyze(prs.parse('\*+ \[\[')) |
29 (inf, 4, ['* [[']) | 29 (inf, 4, ['* [[']) |
30 """ | 30 """ |
31 | 31 |