gate.creole.tokeniser
Class FSMState

java.lang.Object
  |
  +--gate.creole.tokeniser.FSMState
All Implemented Interfaces:
Serializable

class FSMState
extends Object
implements Serializable

A state of the finite state machine that is the kernel tokeniser

See Also:
Serialized Form

Field Summary
private static boolean DEBUG
          Debug flag
(package private) static int index
          used for generating unique ids
(package private)  int myIndex
          the unique index of this state
(package private)  String rhs
          The RHS string value from which the annotation associated to final states is constructed.
(package private)  Set[] transitionFunction
          The transition function of this state.
 
Constructor Summary
FSMState(SimpleTokeniser owner)
          Creates a new FSMState belonging to a specified tokeniser
 
Method Summary
(package private) static void ()
           
(package private)  String getEdgesGML()
          Returns a GML representation of all the edges emerging from this state
(package private)  int getIndex()
          Gets the unique id of this state
(package private)  String getRhs()
          Gets the RHS string value
(package private)  boolean isFinal()
          Checks whether this state is a final one
(package private)  Set nextSet(int type)
          Returns the value of the transition function of this state for a given Unicode type specified using the internal ids used by the tokeniser.
(package private)  Set nextSet(UnicodeType type)
          Returns the value of the transition function of this state for a given Unicode type.
(package private)  void put(int index, FSMState state)
          Adds a new transition to the transition function of this state
(package private)  void put(UnicodeType type, FSMState state)
          Adds a new transition to the transition function of this state
(package private)  void setRhs(String rhs)
          Sets the RHS string value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
Debug flag

transitionFunction

Set[] transitionFunction
The transition function of this state. It's an array mapping from int (the ids used internally by the tokeniser for the Unicode types) to sets of states.

rhs

String rhs
The RHS string value from which the annotation associated to final states is constructed.

myIndex

int myIndex
the unique index of this state

index

static int index
used for generating unique ids
Constructor Detail

FSMState

public FSMState(SimpleTokeniser owner)
Creates a new FSMState belonging to a specified tokeniser
Parameters:
owner - the tokeniser that contains this new state
Method Detail

nextSet

Set nextSet(UnicodeType type)
Returns the value of the transition function of this state for a given Unicode type. As this state can belong to a non-deterministic automaton, the result will be a set.

nextSet

Set nextSet(int type)
Returns the value of the transition function of this state for a given Unicode type specified using the internal ids used by the tokeniser. As this state can belong to a non-deterministic automaton, the result will be a set.

put

void put(UnicodeType type,
         FSMState state)
Adds a new transition to the transition function of this state
Parameters:
type - the restriction for the new transition; if null this transition will be unrestricted.
state - the vaule of the transition function for the given type

put

void put(int index,
         FSMState state)
Adds a new transition to the transition function of this state
Parameters:
index - the internal index of the Unicode type representing the restriction for the new transition;
state - the vaule of the transition function for the given type

setRhs

void setRhs(String rhs)
Sets the RHS string value

getRhs

String getRhs()
Gets the RHS string value

isFinal

boolean isFinal()
Checks whether this state is a final one

getIndex

int getIndex()
Gets the unique id of this state

getEdgesGML

String getEdgesGML()
Returns a GML representation of all the edges emerging from this state

static void ()