Moduleregex-tdfa-1.3.2.5Haskell2010
Text.Regex.TDFA.Common
Common provides simple functions to the backend. It defines most of the data types. All modules should call error via the common_error function below.
- 32 types
- 16 values
- Packageregex-tdfa-1.3.2.5
- Exports48
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceCommon.hs
Used to track elements of the pattern that accept characters or are anchors.
Control whether the pattern is multiline or case-sensitive like Text.Regex and whether to capture the subgroups (\1, \2, etc). Controls enabling extra anchor syntax.
Constructors
CompOptioncaseSensitive :: BoolTrue in blankCompOpt and defaultCompOpt.
multiline :: BoolFalse in blankCompOpt, True in defaultCompOpt. Compile for newline-sensitive matching.
From regexp man page: "By default, newline is a completely ordinary character with no special meaning in either REs or strings. With this flag, inverted bracket expressions
[^and.never match newline, a^anchor matches the null string after any newline in the string in addition to its normal function, and the$anchor matches the null string before any newline in the string in addition to its normal function."rightAssoc :: BoolTrue (and therefore right associative) in blankCompOpt and defaultCompOpt.
newSyntax :: BoolFalse in blankCompOpt, True in defaultCompOpt. Enables the extended non-POSIX syntax described in Text.Regex.TDFA haddock documentation.
lastStarGreedy :: BoolFalse by default. This is POSIX correct but it takes space and is slower. Setting this to True will improve performance, and should be done if you plan to set the captureGroups ExecOption to False.
Instances9Read, Show, RegexOptions, RegexMaker, …
Read CompOptionDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.CommonShow CompOptionDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.CommonRegexOptions Regex CompOption ExecOptionDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.CommonRegexMaker Regex CompOption ExecOption ByteStringDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.ByteString · orphanRegexMaker Regex CompOption ExecOption ByteStringDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.ByteString.Lazy · orphanRegexMaker Regex CompOption ExecOption StringDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.String · orphanRegexMaker Regex CompOption ExecOption TextDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Text · orphanRegexMaker Regex CompOption ExecOption TextDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Text.Lazy · orphanRegexMaker Regex CompOption ExecOption (Seq Char)Defined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Sequence · orphan
Constructors
ExecOptioncaptureGroups :: BoolTrue by default. Set to False to improve speed (and space).
Instances9Read, Show, RegexOptions, RegexMaker, …
Read ExecOptionDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.CommonShow ExecOptionDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.CommonRegexOptions Regex CompOption ExecOptionDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.CommonRegexMaker Regex CompOption ExecOption ByteStringDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.ByteString · orphanRegexMaker Regex CompOption ExecOption ByteStringDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.ByteString.Lazy · orphanRegexMaker Regex CompOption ExecOption StringDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.String · orphanRegexMaker Regex CompOption ExecOption TextDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Text · orphanRegexMaker Regex CompOption ExecOption TextDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Text.Lazy · orphanRegexMaker Regex CompOption ExecOption (Seq Char)Defined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Sequence · orphan
Internal use to indicate type of tag and preference for larger or smaller Positions.
Internal NFA node identity number.
Internal DFA identity is this Set of NFA Index.
Index into the text being searched.
GroupIndex is for indexing submatches from capturing parenthesized groups (PGroup or Group).
GroupInfo collects the parent and tag information for an instance of a group.
Constructors
GroupInfothisIndex :: GroupIndexparentIndex :: GroupIndexstartTag :: TagstopTag :: TagflagTag :: Tag
The TDFA backend specific Regex type, used by this module's RegexOptions and RegexMaker.
Constructors
Regexregex_dfa :: DFAstarting DFA state
regex_init :: Indexindex of starting state
regex_b_index :: (Index, Index)indexes of smallest and largest states
regex_trie :: TrieSet DFAAll DFA states
regex_groups :: Array GroupIndex [GroupInfo]information about each group
regex_isFrontAnchored :: Boolused for optimizing execution
regex_compOptions :: CompOptionregex_execOptions :: ExecOption
Instances19RegexOptions, RegexMaker, RegexLike, RegexContext, …
RegexLike Regex ByteStringDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.ByteString · orphanRegexLike Regex ByteStringDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.ByteString.Lazy · orphanRegexLike Regex StringDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.String · orphanRegexLike Regex TextDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Text · orphanRegexLike Regex TextDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Text.Lazy · orphanRegexContext Regex ByteString ByteStringDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.ByteString · orphanRegexContext Regex ByteString ByteStringDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.ByteString.Lazy · orphanRegexContext Regex String StringDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.String · orphanRegexContext Regex Text TextDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Text · orphanRegexContext Regex Text TextDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Text.Lazy · orphanRegexOptions Regex CompOption ExecOptionDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.CommonRegexMaker Regex CompOption ExecOption ByteStringDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.ByteString · orphanRegexMaker Regex CompOption ExecOption ByteStringDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.ByteString.Lazy · orphanRegexMaker Regex CompOption ExecOption StringDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.String · orphanRegexMaker Regex CompOption ExecOption TextDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Text · orphanRegexMaker Regex CompOption ExecOption TextDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Text.Lazy · orphanRegexMaker Regex CompOption ExecOption (Seq Char)Defined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Sequence · orphanRegexLike Regex (Seq Char)Defined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Sequence · orphanRegexContext Regex (Seq Char) (Seq Char)Defined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Sequence · orphan
Internal type to represent the tagged transition from one QNFA to another (or itself). The key is the Index of the destination QNFA.
Known predicates, just Beginning of Line (^) and End of Line ($). Also support for GNU extensions is being added: \` beginning of buffer, \' end of buffer, \< and \> for begin and end of words, \b and \B for word boundary and not word boundary.
Constructors
Test_BOL^(affected by multiline option)Test_EOL$(affected by multiline option)Test_BOB\`beginning of bufferTest_EOB\'end ofbufferTest_BOW\<beginning of wordTest_EOW\>end of wordTest_EdgeWord\bword boundaryTest_NotEdgeWord\Bnot word boundary
The things that can be done with a Tag. TagTask and ResetGroupStopTask are for tags with Maximize or Minimize OP values. ResetOrbitTask and EnterOrbitTask and LeaveOrbitTask are for tags with Orbit OP value.
Ordered list of tags and their associated Task.
When attached to a QTrans the TagTask can be done before or after accepting the character.
Constructors
Ordered list of tags and their associated update operation.
A TagList and the location of the item in the original pattern that is being accepted.
Ordered list of tags and their associated update operation to perform on an empty transition to the virtual winning state.
Internal DFA node, identified by the Set of indices of the QNFA nodes it represents.
Constructors
Transitiontrans_many :: DFAwhere to go (maximal), including respawning
trans_single :: DFAwhere to go, not including respawning
trans_how :: DTranshow to go, including respawning
Internal to the DFA node
Constructors
Simple'dt_win :: IntMap InstructionsActions to perform to win
dt_trans :: CharMap TransitionTransition to accept Char
dt_other :: Transitiondefault accepting transition
Testing'
Internal type to represent the commands for the tagged transition. The outer IntMap is for the destination Index and the inner IntMap is for the Source Index. This is convenient since all runtime data going to the same destination must be compared to find the best.
A Destination IntMap entry may have an empty Source IntMap if and only if the destination is the starting index and the NFA or DFA. This instructs the matching engine to spawn a new entry starting at the post-update position.
Internal convenience type for the text display code.
Positions for which a * was re-started while looping. Need to
append locations at back but compare starting with front, so use
Seq as a queue. The initial position is saved in basePos (and a
Maximize Tag), the middle positions in the Seq, and the final
position is NOT saved in the Orbits (only in a Maximize Tag).
The newPos and newFlags lists in Instructions are sorted by, and unique in, the Tag values
Constructors
Instances1Show
Show InstructionsDefined in regex-tdfa-1.3.2.5 · Text.Regex.TDFA.Common