| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Regular expressions |
| 5 |
-- |
| 6 |
-- The content of this module (and others in the Regex subdirectory) is |
| 7 |
-- based on Alexandre Agular and Bassel Mannaa's 2009 technical report: |
| 8 |
-- Regular Expressions in Agda |
| 9 |
------------------------------------------------------------------------ |
| 10 |
|
| 11 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 12 |
|
| 13 |
open import Relation.Binary.Bundles using (DecPoset) |
| 14 |
|
| 15 |
module Text.Regex {a e r} (decPoset : DecPoset a e r) where |
| 16 |
|
| 17 |
|
| 18 |
private |
| 19 |
preorder = DecPoset.preorder decPoset |
| 20 |
|
| 21 |
import Text.Regex.Base preorder as Regex |
| 22 |
import Text.Regex.SmartConstructors preorder as Smart |
| 23 |
import Text.Regex.Derivative.Brzozowski decPoset as Eat |
| 24 |
import Text.Regex.Search decPoset as Search |
| 25 |
|
| 26 |
------------------------------------------------------------------------ |
| 27 |
-- Re-exporting basic definition and semantics |
| 28 |
|
| 29 |
open Regex public |
| 30 |
using ( Range; module Range |
| 31 |
; [_]; _─_ |
| 32 |
; Regex; module Regex; Exp; module Exp |
| 33 |
; ε; [^_]; ∅; ·; singleton |
| 34 |
; _∈ᴿ_; _∉ᴿ_ |
| 35 |
; _∈_; _∉_; sum; prod; star |
| 36 |
) |
| 37 |
|
| 38 |
------------------------------------------------------------------------ |
| 39 |
-- Re-exporting smart constructors |
| 40 |
|
| 41 |
open Smart public |
| 42 |
using (_∣_; _∙_; _⋆; _+; _⁇) |
| 43 |
|
| 44 |
------------------------------------------------------------------------ |
| 45 |
-- Re-exporting semantics decidability |
| 46 |
|
| 47 |
open Eat public |
| 48 |
using (_∈?_; _∉?_) |
| 49 |
|
| 50 |
------------------------------------------------------------------------ |
| 51 |
-- Re-exporting search algorithms |
| 52 |
|
| 53 |
open Search public |
| 54 |
using (Span; toInfix; Match; mkMatch; search) |