fr.umlv.tatoo.runtime.lexer.rules
Class DFA

java.lang.Object
  extended by fr.umlv.tatoo.runtime.lexer.rules.DFA

public class DFA
extends Object

This class represents a cursor on an automaton defined by an object of the class RegexTable.

Author:
Julien

Nested Class Summary
static class DFA.ReturnCode
          Return code of the method step(int) of the DFA.
 
Constructor Summary
DFA()
          Creates an empty DFA that must be initialized thru a call to reset(RegexTable).
DFA(RegexTable table)
          Creates a DFA.
 
Method Summary
 RegexTable getTable()
          Returns the automaton table.
 void reset()
          Reset the current DFA.
 void reset(RegexTable table)
          Reuse the current DFA with a new automaton.
 DFA.ReturnCode step(int a)
          Follows the transition from the current state with the letter a.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DFA

public DFA()
Creates an empty DFA that must be initialized thru a call to reset(RegexTable).


DFA

public DFA(RegexTable table)
Creates a DFA.

Parameters:
table - the automaton table.
Method Detail

reset

public void reset(RegexTable table)
Reuse the current DFA with a new automaton.

Parameters:
table - the automaton table.

reset

public void reset()
Reset the current DFA.


step

public DFA.ReturnCode step(int a)
Follows the transition from the current state with the letter a.

Parameters:
a - the letter
Returns:
ACCEPT, REJECT, CONTINUE or FINAL_ACCEPT
See Also:
RegexTable.getTransition(int, int)

toString

public String toString()
Overrides:
toString in class Object

getTable

public RegexTable getTable()
Returns the automaton table.

Returns:
the automaton table.