public class GrammarTransition
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private GrammarAction |
action
The action associated to the transition
|
private java.lang.Enum<Dsmlv2StatesEnum> |
currentState
The current state
|
private java.lang.Enum<Dsmlv2StatesEnum> |
nextState
The next state in the grammar
|
| Constructor and Description |
|---|
GrammarTransition(java.lang.Enum<Dsmlv2StatesEnum> currentState,
java.lang.Enum<Dsmlv2StatesEnum> nextState,
GrammarAction action)
Creates a new GrammarTransition object.
|
| Modifier and Type | Method and Description |
|---|---|
GrammarAction |
getAction()
Gets the action associated with the transition
|
java.lang.Enum<Dsmlv2StatesEnum> |
getNextState()
Gets the target state
|
boolean |
hasAction()
Tells if the transition has an associated action.
|
java.lang.String |
toString(int grammar,
java.lang.Enum<Dsmlv2StatesEnum> statesEnum)
Returns a representation of the transition as a string
|
private java.lang.Enum<Dsmlv2StatesEnum> nextState
private GrammarAction action
private java.lang.Enum<Dsmlv2StatesEnum> currentState
public GrammarTransition(java.lang.Enum<Dsmlv2StatesEnum> currentState, java.lang.Enum<Dsmlv2StatesEnum> nextState, GrammarAction action)
currentState - The current transitionnextState - The target stateaction - The action to execute. It could be null.public java.lang.Enum<Dsmlv2StatesEnum> getNextState()
public boolean hasAction()
true if an action has been associated to the transitionpublic GrammarAction getAction()
public java.lang.String toString(int grammar,
java.lang.Enum<Dsmlv2StatesEnum> statesEnum)
grammar - the grammar which state we want a String fromstatesEnum - the states enum that contains the states' names