static final class RegExpTree.Repetition extends RegExpTree
RegExpTree.Alternation, RegExpTree.Anchor, RegExpTree.BackReference, RegExpTree.CapturingGroup, RegExpTree.Charset, RegExpTree.Concatenation, RegExpTree.DecomposedCharset, RegExpTree.Empty, RegExpTree.LookaheadAssertion, RegExpTree.RegExpTreeAtom, RegExpTree.Repetition, RegExpTree.Text, RegExpTree.WordBoundary
Modifier and Type | Field and Description |
---|---|
(package private) RegExpTree |
body |
(package private) boolean |
greedy |
(package private) int |
max |
(package private) int |
min |
Constructor and Description |
---|
Repetition(RegExpTree body,
int min,
int max,
boolean greedy) |
Modifier and Type | Method and Description |
---|---|
private void |
appendBodySourceCode(java.lang.StringBuilder sb) |
protected void |
appendDebugInfo(java.lang.StringBuilder sb) |
protected void |
appendSourceCode(java.lang.StringBuilder sb)
Appends this regular expression source to the given buffer.
|
java.util.List<? extends RegExpTree> |
children()
The children of this node.
|
boolean |
containsAnchor()
True if the regular expression contains an anchor :
^ or $ . |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
boolean |
isCaseSensitive()
True if the presence or absence of an
"i" flag would change the
meaning of this regular expression. |
int |
numCapturingGroups()
The number of capturing groups.
|
private static int |
numDecimalDigits(int n) |
RegExpTree |
simplify(java.lang.String flags)
Returns a simpler regular expression that is semantically the same assuming
the given flags.
|
private static int |
suffixLen(int min,
int max) |
escapeCharOnto, hasCapturingGroup, matchesWholeInput, parseRegExp, toString
final RegExpTree body
final int min
final int max
final boolean greedy
Repetition(RegExpTree body, int min, int max, boolean greedy)
public RegExpTree simplify(java.lang.String flags)
RegExpTree
simplify
in class RegExpTree
flags
- Regular expression flags, e.g. "igm"
.public boolean isCaseSensitive()
RegExpTree
"i"
flag would change the
meaning of this regular expression.isCaseSensitive
in class RegExpTree
public boolean containsAnchor()
RegExpTree
^
or $
.containsAnchor
in class RegExpTree
public int numCapturingGroups()
RegExpTree
numCapturingGroups
in class RegExpTree
public java.util.List<? extends RegExpTree> children()
RegExpTree
children
in class RegExpTree
private void appendBodySourceCode(java.lang.StringBuilder sb)
private static int suffixLen(int min, int max)
private static int numDecimalDigits(int n)
protected void appendSourceCode(java.lang.StringBuilder sb)
RegExpTree
appendSourceCode
in class RegExpTree
protected void appendDebugInfo(java.lang.StringBuilder sb)
appendDebugInfo
in class RegExpTree
public boolean equals(java.lang.Object o)
equals
in class RegExpTree
public int hashCode()
hashCode
in class RegExpTree