gate.fsm
Class FSM
java.lang.Object
|
+--gate.fsm.FSM
- All Implemented Interfaces:
- JapeConstants, Serializable
- public class FSM
- extends Object
- implements JapeConstants
This class implements a standard Finite State Machine.
It is used for both deterministic and non-deterministic machines.
- See Also:
- Serialized Form
Fields inherited from interface gate.jape.JapeConstants |
APPELT_STYLE, BRILL_STYLE, DEFAULT_PRIORITY, FIRST_STYLE, INDENT_PADDING, KLEENE_PLUS, KLEENE_QUERY, KLEENE_STAR, MULTI_SPAN_BINDING, NO_BINDING, NO_KLEENE_OP, SINGLE_SPAN_BINDING |
Constructor Summary |
FSM(FSM owner,
Rule rule)
Builds a FSM starting from a rule. |
FSM(FSM owner,
SinglePhaseTransducer spt)
This constructor creates a finite state machine starting from a
single phase transducer. |
FSM(SinglePhaseTransducer spt)
Builds a standalone FSM starting from a single phase transducer. |
Method Summary |
void |
eliminateVoidTransitions()
Converts this FSM from a non-deterministic to a deterministic one by
eliminating all the unrestricted transitions. |
String |
getGML()
Returns a GML (Graph Modelling Language) representation of the transition
graph of this FSM. |
State |
getInitialState()
Gets the initial state of this FSM |
String |
toString()
Returns a textual description of this FSM. |
FSM
public FSM(FSM owner,
SinglePhaseTransducer spt)
- This constructor creates a finite state machine starting from a
single phase transducer. The FSM built by this constructor is supposed
to be a part of a larger FSM which is sent using the owner parameter.
All the new states created during the build process belong to the
owner FSM.
- Parameters:
owner
- the larger FSM that will contain this FSM as a sub-set.spt
- the single phase transducer to be used for building this FSM.
FSM
public FSM(SinglePhaseTransducer spt)
- Builds a standalone FSM starting from a single phase transducer.
- Parameters:
spt
- the single phase transducer to be used for building this FSM.
FSM
public FSM(FSM owner,
Rule rule)
- Builds a FSM starting from a rule. This FSM is actually a part of a larger
one (usually the one that is built based on the single phase transducer
that contains the rule).
- Parameters:
owner
- the larger FSM that wil own all the states in the new FSM
built by this constructor.rule
- the rule to be used for the building process.
getInitialState
public State getInitialState()
- Gets the initial state of this FSM
- Returns:
- an object of type gate.fsm.State representing the initial state.
eliminateVoidTransitions
public void eliminateVoidTransitions()
- Converts this FSM from a non-deterministic to a deterministic one by
eliminating all the unrestricted transitions.
getGML
public String getGML()
- Returns a GML (Graph Modelling Language) representation of the transition
graph of this FSM.
toString
public String toString()
- Returns a textual description of this FSM.
- Overrides:
toString
in class Object