public static class Operation.OpRepeat extends Operation
Operation.OpAtom, Operation.OpBackReference, Operation.OpBOL, Operation.OpCapture, Operation.OpCharClass, Operation.OpChoice, Operation.OpEndProgram, Operation.OpEOL, Operation.OpGreedyFixed, Operation.OpNothing, Operation.OpReluctantFixed, Operation.OpRepeat, Operation.OpSequence, Operation.OpTrace, Operation.OpUnambiguousRepeat
Modifier and Type | Field and Description |
---|---|
protected boolean |
greedy |
protected int |
max |
protected int |
min |
protected Operation |
op |
Constructor and Description |
---|
OpRepeat(Operation op,
int min,
int max,
boolean greedy) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsCapturingExpressions()
Ask whether the expression contains any capturing sub-expressions
|
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
|
Operation |
getRepeatedOperation()
Get the operation being repeated
|
IntIterator |
iterateMatches(REMatcher matcher,
int position)
Get an iterator returning all the matches for this operation
|
boolean |
matchesEmptyString()
Ask whether the regular expression is capable of matching a zero-length string
|
Operation |
optimize(REProgram program,
REFlags flags)
Optimize the operation
|
protected Operation op
protected int min
protected int max
protected boolean greedy
public OpRepeat(Operation op, int min, int max, boolean greedy)
public Operation getRepeatedOperation()
public boolean matchesEmptyString()
Operation
matchesEmptyString
in class Operation
public boolean containsCapturingExpressions()
Operation
containsCapturingExpressions
in class Operation
public CharacterClass getInitialCharacterClass(boolean caseBlind)
Operation
getInitialCharacterClass
in class Operation
caseBlind
- true if case-blind matching is in force ("i" flag)public int getMatchLength()
Operation
getMatchLength
in class Operation
public int getMinimumMatchLength()
Operation
getMinimumMatchLength
in class Operation
public Operation optimize(REProgram program, REFlags flags)
Operation
public IntIterator iterateMatches(REMatcher matcher, int position)
Operation
iterateMatches
in class Operation
matcher
- supplies the context for the matching; may be updated with information about
captured groupsposition
- the start position to seek a matchCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.