Class DFAInitialStateNode

java.lang.Object
com.oracle.truffle.regex.tregex.nodes.dfa.DFAAbstractStateNode
com.oracle.truffle.regex.tregex.nodes.dfa.DFAInitialStateNode
All Implemented Interfaces:
JsonConvertible

public class DFAInitialStateNode extends DFAAbstractStateNode
This state node is responsible for selecting a DFA's initial state based on the index the search starts from. Successors are entry points in case we start matching at the beginning of the input string, followed by entry points in case we do not start matching at the beginning of the input string. If possible matches must start at the beginning of the input string, entry points may be -1.
  • Constructor Details

    • DFAInitialStateNode

      public DFAInitialStateNode(short[] successors, short[] cgLastTransition)
  • Method Details

    • getCgLastTransition

      public short[] getCgLastTransition()
    • getPrefixLength

      public int getPrefixLength()
    • hasUnAnchoredEntry

      public boolean hasUnAnchoredEntry()
    • createNodeSplitCopy

      public DFAAbstractStateNode createNodeSplitCopy(short copyID)
      Creates a node split copy of this initial state as described in DFAAbstractStateNode, but ignores copyID, since having two initial states in a DFA is not supported. Therefore, this method should be used for replacing the original initial state with the copy.
      Specified by:
      createNodeSplitCopy in class DFAAbstractStateNode
      Parameters:
      copyID - new ID for the copy.
      Returns:
      a node split copy of this initial state as described in DFAAbstractStateNode, ignoring copyID.
    • toJson

      public JsonValue toJson()