Package relaxngcc.automaton
Class State
- java.lang.Object
-
- relaxngcc.automaton.State
-
- All Implemented Interfaces:
java.lang.Comparable
public final class State extends java.lang.Object implements java.lang.ComparableA State object has zero or more Transition objects
-
-
Field Summary
Fields Modifier and Type Field Description Pattern_locationHintPattern from which this state was created.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActionOnExit(ScopeInfo.Action act)voidaddActionsOnExit(ScopeInfo.Action[] act)voidaddTransition(Transition t)java.util.SetAFollow()java.util.SetattHead()Computes ATTHEAD set of this state and returns them in a sorted order.voidcalcAFOLLOW()Computes AFOLLOW from this state.intcompareTo(java.lang.Object obj)TransitionfindTransition(Alphabet a)finds a transition invoked by the passed alphabetScopeInfo.Action[]getActionsOnExit()ScopeInfogetContainer()intgetIndex()State[]getReachableStates()Gets all the states reachable from this state.booleanhasTransition(int alphabetTypes)Checks if this state has transitions with at least one of given types of alphabets.java.util.Sethead(boolean includeEE)Computes HEAD set of this state.booleanisAcceptable()java.util.IteratoriterateTransitions()java.util.IteratoriterateTransitions(int alphabetTypes)Iterate transitions with specified alphabets.voidmergeTransitions(State s)voidmergeTransitions(State s, ScopeInfo.Action action)For all the transitions leaving from the specified state, add it to this state by appending the specified action (possibly null) at the head of its prologue actions.voidoutputActionsOnExit(CDBlock sv)Gets the code to invoke exit-actions.voidremoveTransition(Transition t)voidsetAcceptable(boolean newvalue)
-
-
-
Field Detail
-
_locationHint
public final Pattern _locationHint
Pattern from which this state was created.
-
-
Method Detail
-
setAcceptable
public void setAcceptable(boolean newvalue)
-
isAcceptable
public boolean isAcceptable()
-
getActionsOnExit
public ScopeInfo.Action[] getActionsOnExit()
-
outputActionsOnExit
public void outputActionsOnExit(CDBlock sv)
Gets the code to invoke exit-actions.
-
addActionOnExit
public void addActionOnExit(ScopeInfo.Action act)
-
addActionsOnExit
public void addActionsOnExit(ScopeInfo.Action[] act)
-
getContainer
public ScopeInfo getContainer()
-
getIndex
public int getIndex()
-
addTransition
public void addTransition(Transition t)
-
removeTransition
public void removeTransition(Transition t)
-
iterateTransitions
public java.util.Iterator iterateTransitions()
-
hasTransition
public boolean hasTransition(int alphabetTypes)
Checks if this state has transitions with at least one of given types of alphabets.- Parameters:
alphabetTypes- OR-ed combination of alphabet types you want to iterate.
-
iterateTransitions
public java.util.Iterator iterateTransitions(int alphabetTypes)
Iterate transitions with specified alphabets.- Parameters:
alphabetTypes- OR-ed combination of alphabet types you want to iterate.
-
compareTo
public int compareTo(java.lang.Object obj)
- Specified by:
compareToin interfacejava.lang.Comparable
-
mergeTransitions
public void mergeTransitions(State s)
-
mergeTransitions
public void mergeTransitions(State s, ScopeInfo.Action action)
For all the transitions leaving from the specified state, add it to this state by appending the specified action (possibly null) at the head of its prologue actions.
-
findTransition
public Transition findTransition(Alphabet a)
finds a transition invoked by the passed alphabet
-
getReachableStates
public State[] getReachableStates()
Gets all the states reachable from this state.
-
head
public java.util.Set head(boolean includeEE)
Computes HEAD set of this state. SeeHeadfor the definition.
-
attHead
public java.util.Set attHead()
Computes ATTHEAD set of this state and returns them in a sorted order. SeeHEADfor the definition.
-
AFollow
public java.util.Set AFollow()
-
calcAFOLLOW
public void calcAFOLLOW()
Computes AFOLLOW from this state.
-
-