Class PureNFA
java.lang.Object
com.oracle.truffle.regex.tregex.nfa.PureNFA
- All Implemented Interfaces:
StateIndex<PureNFAState>
A NFA that corresponds to the subtree of one
RegexASTSubtreeRootNode.-
Constructor Summary
ConstructorsConstructorDescriptionPureNFA(RegexASTSubtreeRootNode astSubRoot, PureNFAState[] states, Counter.ThresholdCounter stateIDCounter, Counter.ThresholdCounter transitionIDCounter) -
Method Summary
Modifier and TypeMethodDescriptiongetASTSubtree(RegexAST ast) Get this NFA's "dummy initial state".intintgetId(PureNFAState state) getMergedInitialStateCharSet(RegexAST ast, CompilationBuffer compilationBuffer) Creates aCodePointSetthat matches the union of all code point sets ofcharacter class successor statesof the root NFA'sunanchored initial state.intintgetState(int id) intSubtree IDof theRegexASTSubtreeRootNodethis NFA was generated from.PureNFA[]booleanisRoot()voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.oracle.truffle.regex.tregex.automaton.StateIndex
isEmpty
-
Constructor Details
-
PureNFA
public PureNFA(RegexASTSubtreeRootNode astSubRoot, PureNFAState[] states, Counter.ThresholdCounter stateIDCounter, Counter.ThresholdCounter transitionIDCounter)
-
-
Method Details
-
getSubTreeId
public int getSubTreeId()Subtree IDof theRegexASTSubtreeRootNodethis NFA was generated from. -
getGlobalSubTreeId
public int getGlobalSubTreeId() -
isRoot
public boolean isRoot() -
getASTSubtree
-
getDummyInitialState
Get this NFA's "dummy initial state". SinceDFAGeneratorworks on sets of NFA transitions, we need pseudo-transitions to the NFA's initial states as entry points for the DFA generator. The dummy initial state provides these transitions, in a fixed layout: The first half of itssuccessorslead to the NFA's anchored initial states, and the second half leads to the unanchored initial states. -
getAnchoredEntry
-
getUnAnchoredEntry
-
getUnAnchoredInitialState
-
getAnchoredInitialState
-
getStates
-
getTransitions
-
getSubtrees
-
getNumberOfStates
public int getNumberOfStates()- Specified by:
getNumberOfStatesin interfaceStateIndex<PureNFAState>
-
getNumberOfTransitions
public int getNumberOfTransitions() -
getId
- Specified by:
getIdin interfaceStateIndex<PureNFAState>
-
getState
- Specified by:
getStatein interfaceStateIndex<PureNFAState>
-
materializeGroupBoundaries
public void materializeGroupBoundaries() -
getMergedInitialStateCharSet
Creates aCodePointSetthat matches the union of all code point sets ofcharacter class successor statesof the root NFA'sunanchored initial state. If this can not be calculated, e.g. because one of the successors is anempty match state,nullis returned. -
toJson
-