public abstract class HybridBitSetMatcher extends InvertibleCharMatcher
RangeTreeMatcher, but replaces some subtrees with bit-set matches. Specifically, if the
character set contains many short ranges that differ only in the lowest byte, those ranges are
converted to a bit-set, which is checked when the binary search finds that the given character is
in the byte range denoted by the bit set. The threshold for bit-set conversion is defined by
TRegexOptions.TRegexRangeToBitSetConversionThreshold.
Example:
Character set: [0x02, 0x04, 0x06, 0x1000, 0x1020-0x1030] Resulting Hybrid matcher with threshold = 3: - ranges: [0x02-0x06, 0x1000, 0x1020-0x1030] - bit-sets: [[0x02, 0x04, 0x06], null, null ]
CompressedCodePointSetEMPTY| Modifier and Type | Method and Description |
|---|---|
static HybridBitSetMatcher |
create(boolean invert,
CompressedCodePointSet ccps) |
int |
estimatedCost()
Conservatively estimate the equivalent number of integer comparisons of calling
CharMatcher.execute(int). |
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 HybridBitSetMatcher create(boolean invert, CompressedCodePointSet ccps)
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