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, toStringfinal 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)
RegExpTreesimplify in class RegExpTreeflags - Regular expression flags, e.g. "igm".public boolean isCaseSensitive()
RegExpTree"i" flag would change the
meaning of this regular expression.isCaseSensitive in class RegExpTreepublic boolean containsAnchor()
RegExpTree^ or $.containsAnchor in class RegExpTreepublic int numCapturingGroups()
RegExpTreenumCapturingGroups in class RegExpTreepublic java.util.List<? extends RegExpTree> children()
RegExpTreechildren in class RegExpTreeprivate 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)
RegExpTreeappendSourceCode in class RegExpTreeprotected void appendDebugInfo(java.lang.StringBuilder sb)
appendDebugInfo in class RegExpTreepublic boolean equals(java.lang.Object o)
equals in class RegExpTreepublic int hashCode()
hashCode in class RegExpTree