|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gate.fsm.FSM
This class implements a standard Finite State Machine. It is used for both deterministic and non-deterministic machines.
Field Summary | |
private Collection |
allStates
The set of states for this FSM |
private static boolean |
DEBUG
Debug flag |
private State |
initialState
The initial state of this FSM. |
private FSM |
owner
The top level FSM that contains this FSM, null if this FSM is a top level one. |
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 | |
protected void |
addState(State state)
Add a new state to the set of states belonging to this FSM. |
private State |
convertComplexPE(FSM owner,
State startState,
ComplexPatternElement cpe,
LinkedList labels)
Receives a state to start from and a complex pattern element. |
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 |
private AbstractSet |
lambdaClosure(AbstractSet s)
|
String |
toString()
Returns a textual description of this FSM. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static final boolean DEBUG
private State initialState
private transient Collection allStates
private FSM owner
Constructor Detail |
public FSM(FSM owner, SinglePhaseTransducer spt)
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.public FSM(SinglePhaseTransducer spt)
spt
- the single phase transducer to be used for building this FSM.public FSM(FSM owner, Rule rule)
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.Method Detail |
public State getInitialState()
private State convertComplexPE(FSM owner, State startState, ComplexPatternElement cpe, LinkedList labels)
state
- the state to start fromcpe
- the pattern to be recognizedlabel
- the bindings name for all the annotation accepted along
the way this is actually a listy of Strings. It is necessary to use
a list becuase of the reccursive definition of ComplexPatternElement.protected void addState(State state)
state
- the new state to be addedpublic void eliminateVoidTransitions()
private AbstractSet lambdaClosure(AbstractSet s)
public String getGML()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |