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(int). |
static RangeTreeMatcher |
fromRanges(boolean invert,
int[] ranges)
Constructs a new
RangeTreeMatcher. |
boolean |
match(int c) |
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, int[] 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(int c)
public int estimatedCost()
CharMatcherCharMatcher.execute(int).estimatedCost in class CharMatcherCharMatcher.execute(int) is roughly
equivalent to. Array loads are treated as two comparisons.public String toString()
toString in class com.oracle.truffle.api.nodes.Node