public abstract class RangeTreeMatcher extends InvertibleCharMatcher
match(char c) {
if (c < 4) {
return 1 <= c && c <= 2;
} else if (c > 5) {
if (c < 10) {
return false;
} else if (c > 11) {
return 20 <= c && c <= 22;
} else {
return true;
}
} else {
return true;
}
}
EMPTY| Modifier and Type | Method and Description |
|---|---|
int |
estimatedCost()
Conservatively estimate the equivalent number of integer comparisons of calling
CharMatcher.execute(char, boolean). |
static RangeTreeMatcher |
fromRanges(boolean invert,
char[] ranges)
Constructs a new
RangeTreeMatcher. |
boolean |
match(char c,
boolean compactString) |
String |
toString() |
modifiersToString, resultexecuteaccept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, lookupContextReference, lookupLanguageReference, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecializepublic static RangeTreeMatcher fromRanges(boolean invert, char[] ranges)
RangeTreeMatcher.invert - see InvertibleCharMatcher.ranges - a sorted array of character ranges in the form [lower inclusive bound of range
0, higher inclusive bound of range 0, lower inclusive bound of range 1, higher
inclusive bound of range 1, ...]. The array contents are not modified by this
method.RangeTreeMatcher.public boolean match(char c,
boolean compactString)
public int estimatedCost()
CharMatcherCharMatcher.execute(char, boolean).estimatedCost in class CharMatcherCharMatcher.execute(char, boolean) is
roughly equivalent to. Array loads are treated as two comparisons.public String toString()
toString in class com.oracle.truffle.api.nodes.Node