Class AllTransitionsInOneTreeMatcher
java.lang.Object
com.oracle.truffle.regex.tregex.nodes.dfa.Matchers
com.oracle.truffle.regex.tregex.nodes.dfa.AllTransitionsInOneTreeMatcher
This class provides an alternative way of calculating the next transition - instead of checking
all transitions in sequential manner, all ranges of all transitions are merged into one sorted
array, which is then searched in tree-recursive fashion.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classData structure for optimized matching of multiple ranges in one lower byte range. -
Constructor Summary
ConstructorsConstructorDescriptionAllTransitionsInOneTreeMatcher(int[] ranges, short[] successors, AllTransitionsInOneTreeMatcher.AllTransitionsInOneTreeLeafMatcher[] leafMatchers) Constructs a newAllTransitionsInOneTreeMatcher. -
Method Summary
-
Constructor Details
-
AllTransitionsInOneTreeMatcher
public AllTransitionsInOneTreeMatcher(int[] ranges, short[] successors, AllTransitionsInOneTreeMatcher.AllTransitionsInOneTreeLeafMatcher[] leafMatchers) Constructs a newAllTransitionsInOneTreeMatcher.- Parameters:
ranges- a sorted list of adjacent character ranges, in the following format: Every character in the array simultaneously represents the inclusive lower bound of a range and the exclusive upper bound of a range. The algorithm adds an implicit zero at the begin and an implicitConstants.MAX_CODE_POINT+ 1 at the end of the array. An array representing the ranges[0x00-0x10][0x10-0xff][0xff-0x2000][0x2000-0x10ffff](represented with exclusive upper bound) would be:[0x10, 0xff, 0x2000].successors- the list of successors corresponding to every range in the sorted list of ranges. Every entry in this array is an index ofDFAAbstractStateNode.getSuccessors(), or a negative index. A negative index can mean one of two things:-1denotes "no successor", indices below-1denoteleaf matchers. These specialized matchers are used when many ranges lie in the same lower byte range, i.e. all bytes of their numerical values except the lowest one are equal (e.g.[0x2020-0x2021][0x2030-0x2031]...).
-
-
Method Details
-
checkMatchTree
public int checkMatchTree(int c) -
toString
-