regex-tdfa-0.97.1: Accurate POSIX extended regular expression library

Text.Regex.TDFA.CorePattern

Description

The CorePattern module deconstructs the Pattern tree created by ReadRegex.parseRegex and returns a simpler Q/P tree with annotations at each Q node. This will be converted by the TNFA module into a QNFA finite automata.

Of particular note, this Pattern to Q/P conversion creates and assigns all the internal Tags that will be used during the matching process, and associates the captures groups with the tags that represent their starting and ending locations and with their immediate parent group.

Each Maximize and Minimize tag is held as either a preTag or a postTag by one and only one location in the Q/P tree. The Orbit tags are each held by one and only one Star node. Tags that stop a Group are also held in perhaps numerous preReset lists.

The additional nullQ::nullView field of Q records the potentially complex information about what tests and tags must be used if the pattern unQ::P matches 0 zero characters. There can be redundancy in nullView, which is eliminated by cleanNullView.

Uses recursive do notation.

Synopsis

Documentation

data Q Source

Constructors

Q 

Instances

Eq Q 
Show Q 

data P Source

Instances

Eq P 
Show P 

data WhichTest Source

Known predicates, just Beginning of Line (^) and End of Line ($).

Constructors

Test_BOL 
Test_EOL 

data OP Source

Constructors

Maximize 
Minimize 
Orbit 

Instances