Safe Haskell | None |
---|

This module defines the data type of internal regular expression pattern, | as well as the partial derivative operations for regular expression patterns.

# Documentation

regular expression patterns

PVar Int [Range] Pat | variable pattern |

PE [RE] | pattern without binder |

PPair Pat Pat | pair pattern |

PChoice [Pat] GFlag | choice pattern |

PStar Pat GFlag | star pattern |

PPlus Pat Pat | plus pattern, it is used internally to indicate that it is unrolled from a PStar |

PEmpty Pat | empty pattern, it is used intermally to indicate that mkEmpty function has been applied. |

Eq Pat | The Eq instance for Pat data type NOTE: We ignore the 'consumed word' when comparing patterns (ie we only compare the pattern structure). Essential for later comparisons among patterns. |

Ord Pat | |

Show Pat | |

Hashable Pat | |

Key Pat | |

Pretty Pat | |

IsGreedy Pat | Function |

Simplifiable Pat | mainly interested in simplifying epsilon, p --> p could be made more optimal, e.g. (epsilon, epsilon) --> epsilon |

IsPhi Pat | |

IsEpsilon Pat | |

RegexOptions Regex CompOption ExecOption |

type Binder = IntMap [Range]Source

The `Binder`

type denotes a set of (pattern var * range) pairs
type Binder = [(Int, [Range])]

listifyBinder :: Binder -> [(Int, [Range])]Source