public final class State
extends java.lang.Object
implements java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
Pattern |
_locationHint
Pattern from which this state was created.
|
Constructor and Description |
---|
State(ScopeInfo container,
int index,
Pattern location) |
Modifier and Type | Method and Description |
---|---|
void |
addActionOnExit(ScopeInfo.Action act) |
void |
addActionsOnExit(ScopeInfo.Action[] act) |
void |
addTransition(Transition t) |
java.util.Set |
AFollow() |
java.util.Set |
attHead()
Computes ATTHEAD set of this state and returns them
in a sorted order.
|
void |
calcAFOLLOW()
Computes AFOLLOW from this state.
|
int |
compareTo(java.lang.Object obj) |
Transition |
findTransition(Alphabet a)
finds a transition invoked by the passed alphabet
|
ScopeInfo.Action[] |
getActionsOnExit() |
ScopeInfo |
getContainer() |
int |
getIndex() |
State[] |
getReachableStates()
Gets all the states reachable from this state.
|
boolean |
hasTransition(int alphabetTypes)
Checks if this state has transitions with
at least one of given types of alphabets.
|
java.util.Set |
head(boolean includeEE)
Computes HEAD set of this state.
|
boolean |
isAcceptable() |
java.util.Iterator |
iterateTransitions() |
java.util.Iterator |
iterateTransitions(int alphabetTypes)
Iterate transitions with specified alphabets.
|
void |
mergeTransitions(State s) |
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.
|
void |
outputActionsOnExit(CDBlock sv)
Gets the code to invoke exit-actions.
|
void |
removeTransition(Transition t) |
void |
setAcceptable(boolean newvalue) |
public final Pattern _locationHint
public void setAcceptable(boolean newvalue)
public boolean isAcceptable()
public ScopeInfo.Action[] getActionsOnExit()
public void outputActionsOnExit(CDBlock sv)
public void addActionOnExit(ScopeInfo.Action act)
public void addActionsOnExit(ScopeInfo.Action[] act)
public ScopeInfo getContainer()
public int getIndex()
public void addTransition(Transition t)
public void removeTransition(Transition t)
public java.util.Iterator iterateTransitions()
public boolean hasTransition(int alphabetTypes)
alphabetTypes
- OR-ed combination of alphabet types you want to iterate.public java.util.Iterator iterateTransitions(int alphabetTypes)
alphabetTypes
- OR-ed combination of alphabet types you want to iterate.public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
public void mergeTransitions(State s)
public void mergeTransitions(State s, ScopeInfo.Action action)
public Transition findTransition(Alphabet a)
public State[] getReachableStates()
public java.util.Set head(boolean includeEE)
Head
for the definition.public java.util.Set attHead()
HEAD
for the definition.public java.util.Set AFollow()
public void calcAFOLLOW()