Class PureNFAState
java.lang.Object
com.oracle.truffle.regex.tregex.automaton.BasicState<PureNFAState,PureNFATransition>
com.oracle.truffle.regex.tregex.nfa.PureNFAState
- All Implemented Interfaces:
AbstractState<PureNFAState,PureNFATransition>
Represents a state of a
PureNFA. All PureNFAStates correspond to a single
RegexASTNode, referenced by getAstNodeId(). Initial and final states correspond
to the NFA helper nodes contained in RegexASTSubtreeRootNode. All other states correspond
to either CharacterClasses, BackReferences, LookAroundAssertions or
AtomicGroups.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortFields inherited from class com.oracle.truffle.regex.tregex.automaton.BasicState
FLAG_ANCHORED_FINAL_STATE, FLAG_ANCHORED_INITIAL_STATE, FLAG_ANY_FINAL_STATE, FLAG_ANY_INITIAL_OR_FINAL_STATE, FLAG_ANY_INITIAL_STATE, FLAG_UN_ANCHORED_FINAL_STATE, FLAG_UN_ANCHORED_INITIAL_STATE, N_FLAGS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLoopBackNext(PureNFATransition transition) booleanprotected PureNFATransition[]createTransitionsArray(int length) getAstNode(RegexAST ast) int[]bytegetKind()intprotected booleanhasTransitionToUnAnchoredFinalState(boolean forward) voidinitIsDeterministic(CompilationBuffer compilationBuffer) Initializes this state'sisDeterministic()-property.booleanbooleanState represents aBackReference.booleanState represents aCharacterClass.booleanA state is considered "deterministic" iff it either has only one successor, or all of its successors representcharacter classes, and none of those character classes intersect.booleanState represents an empty loop iteration in a quantified expression.booleanbooleanbooleanisLookAhead(RegexAST ast) booleanbooleanisLookBehind(RegexAST ast) booleanbooleanState represents aLookAroundAssertionor anAtomicGroup.booleanvoidvoidsetDeterministic(boolean value) voidsetIgnoreCaseReference(boolean value) voidsetIgnoreCaseReferenceAlternativeMode(boolean value) voidsetLookAround(boolean value) voidsetRecursiveReference(boolean value) voidsetSubMatcherNegated(boolean value) toString()Methods inherited from class com.oracle.truffle.regex.tregex.automaton.BasicState
addPredecessor, addPredecessorUnchecked, getFlag, getFlags, getId, getNPredecessors, getPredecessors, getPredecessors, getSuccessors, getSuccessors, hasPredecessors, hasSuccessors, incPredecessors, isAnchoredFinalState, isAnchoredFinalState, isAnchoredInitialState, isAnchoredInitialState, isDead, isFinalState, isFinalState, isInitialState, isInitialState, isUnAnchoredFinalState, isUnAnchoredFinalState, isUnAnchoredInitialState, isUnAnchoredInitialState, setAnchoredFinalState, setAnchoredInitialState, setFlag, setFlag, setPredecessors, setSuccessors, setUnAnchoredFinalState, setUnAnchoredInitialState, setUnAnchoredInitialState
-
Field Details
-
KIND_INITIAL_OR_FINAL_STATE
public static final short KIND_INITIAL_OR_FINAL_STATE- See Also:
-
KIND_CHARACTER_CLASS
public static final short KIND_CHARACTER_CLASS- See Also:
-
KIND_SUB_MATCHER
public static final short KIND_SUB_MATCHER- See Also:
-
KIND_BACK_REFERENCE
public static final short KIND_BACK_REFERENCE- See Also:
-
KIND_EMPTY_MATCH
public static final short KIND_EMPTY_MATCH- See Also:
-
-
Constructor Details
-
PureNFAState
-
-
Method Details
-
getAstNode
-
getKind
public byte getKind() -
isCharacterClass
public boolean isCharacterClass()State represents aCharacterClass. -
isSubMatcher
public boolean isSubMatcher()State represents aLookAroundAssertionor anAtomicGroup. -
isLookAhead
-
isLookBehind
-
isAtomicGroup
public boolean isAtomicGroup() -
isBackReference
public boolean isBackReference()State represents aBackReference. -
isEmptyMatch
public boolean isEmptyMatch()State represents an empty loop iteration in a quantified expression. This kind of state is needed when a quantified expression whereToken.Quantifier.getMin()> 0 can match the empty string - e.g.(a|){10,20}. In such expressions, the quantifier must match the empty string until the minimum number of iterations is reached, but after that it is no longer allowed to match the empty string. To model this behavior, we insert an "empty match" state whenever a quantified expression that can match the empty string is encountered. -
getCharSet
-
getSubtreeId
public int getSubtreeId() -
getBackRefNumbers
public int[] getBackRefNumbers() -
isLookAround
public boolean isLookAround() -
setLookAround
public void setLookAround(boolean value) -
isSubMatcherNegated
public boolean isSubMatcherNegated() -
setSubMatcherNegated
public void setSubMatcherNegated(boolean value) -
isIgnoreCaseReference
public boolean isIgnoreCaseReference() -
setIgnoreCaseReference
public void setIgnoreCaseReference(boolean value) -
isRecursiveReference
public boolean isRecursiveReference() -
setRecursiveReference
public void setRecursiveReference(boolean value) -
isIgnoreCaseReferenceAlternativeMode
public boolean isIgnoreCaseReferenceAlternativeMode() -
setIgnoreCaseReferenceAlternativeMode
public void setIgnoreCaseReferenceAlternativeMode(boolean value) -
isDeterministic
public boolean isDeterministic()A state is considered "deterministic" iff it either has only one successor, or all of its successors representcharacter classes, and none of those character classes intersect.- See Also:
-
setDeterministic
public void setDeterministic(boolean value) -
initIsDeterministic
Initializes this state'sisDeterministic()-property. -
createTransitionsArray
- Specified by:
createTransitionsArrayin classBasicState<PureNFAState,PureNFATransition>
-
addLoopBackNext
-
removeLoopBackNext
public void removeLoopBackNext() -
hasTransitionToUnAnchoredFinalState
protected boolean hasTransitionToUnAnchoredFinalState(boolean forward) - Specified by:
hasTransitionToUnAnchoredFinalStatein classBasicState<PureNFAState,PureNFATransition>
-
canMatchZeroWidth
public boolean canMatchZeroWidth() -
toString
-
toJson
-