public abstract class Operation
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Operation.OpAtom
A match against a fixed string of any length
|
static class |
Operation.OpBackReference
Back-reference
|
static class |
Operation.OpBOL
Beginning of Line (^)
|
static class |
Operation.OpCapture
Open paren (captured group)
|
static class |
Operation.OpCharClass
A match of a single character in the input against a set of permitted characters
|
static class |
Operation.OpChoice
A choice of several branches
|
static class |
Operation.OpEndProgram
End of program
|
static class |
Operation.OpEOL
End of Line ($)
|
static class |
Operation.OpGreedyFixed
Handle a greedy repetition (with possible min and max) where the
size of the repeated unit is fixed.
|
static class |
Operation.OpNothing
Match empty string
|
static class |
Operation.OpReluctantFixed
Handle a reluctant repetition (with possible min and max) where the
size of the repeated unit is fixed.
|
static class |
Operation.OpRepeat
Handle a greedy repetition (with possible min and max) where the
size of the repeated unit is variable.
|
static class |
Operation.OpSequence
A sequence of multiple pieces
|
static class |
Operation.OpTrace
Operation that wraps a base operation and traces its execution
|
static class |
Operation.OpUnambiguousRepeat
Handle a repetition where there is no ambiguity; if the repeated
term is matched in the string, then it cannot match anything other than
the repeated term.
|
Constructor and Description |
---|
Operation() |
Modifier and Type | Method and Description |
---|---|
boolean |
containsCapturingExpressions()
Ask whether the expression contains any capturing sub-expressions
|
abstract java.lang.String |
display()
Display the operation as a regular expression, possibly in abbreviated form
|
CharacterClass |
getInitialCharacterClass(boolean caseBlind)
Get a CharacterClass identifying the set of characters that can appear as the first
character of a non-empty string that matches this term.
|
int |
getMatchLength()
Get the length of the matches returned by this operation if they are fixed-length
|
int |
getMinimumMatchLength()
Get the minimum length of the matches returned by this operation
|
abstract IntIterator |
iterateMatches(REMatcher matcher,
int position)
Get an iterator returning all the matches for this operation
|
abstract boolean |
matchesEmptyString()
Ask whether the regular expression is capable of matching a zero-length string
|
Operation |
optimize(REProgram program,
REFlags flags)
Optimize the operation
|
public abstract IntIterator iterateMatches(REMatcher matcher, int position)
matcher
- supplies the context for the matching; may be updated with information about
captured groupsposition
- the start position to seek a matchpublic int getMatchLength()
public int getMinimumMatchLength()
public abstract boolean matchesEmptyString()
public boolean containsCapturingExpressions()
public CharacterClass getInitialCharacterClass(boolean caseBlind)
caseBlind
- true if case-blind matching is in force ("i" flag)public Operation optimize(REProgram program, REFlags flags)
program
- the program being optimizedflags
- the regular expression flagspublic abstract java.lang.String display()
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.