| 1030 |
let complex_memo = Hashtbl.create 213 |
let complex_memo = Hashtbl.create 213 |
| 1031 |
|
|
| 1032 |
let rec regexp_of_term = function |
let rec regexp_of_term = function |
| 1033 |
| All _ -> assert false |
| All [] | Choice [] | Sequence [] -> PEpsilon |
|
| Choice [] -> PEpsilon |
|
| 1034 |
| Choice (hd :: tl) -> |
| Choice (hd :: tl) -> |
| 1035 |
List.fold_left |
List.fold_left |
| 1036 |
(fun acc particle -> PAlt (acc, regexp_of_particle particle)) |
(fun acc particle -> PAlt (acc, regexp_of_particle particle)) |
| 1037 |
(regexp_of_particle hd) tl |
(regexp_of_particle hd) tl |
| 1038 |
| Sequence [] -> PEpsilon |
| All (hd :: tl) | Sequence (hd :: tl) -> |
|
| Sequence (hd :: tl) -> |
|
| 1039 |
List.fold_left |
List.fold_left |
| 1040 |
(fun acc particle -> PSeq (acc, regexp_of_particle particle)) |
(fun acc particle -> PSeq (acc, regexp_of_particle particle)) |
| 1041 |
(regexp_of_particle hd) tl |
(regexp_of_particle hd) tl |