|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.umlv.tatoo.runtime.regex.CharRegexTable
public class CharRegexTable
A RegexTable
implementation for DFA which uses all unicode characters.
Transitions are represented coding characters intervals using arrays:
if the array is {a,b,c,d}, it means to from character a to c, DFA goes to state
b; from character c to '', DFA goes to d. Going to state -1 means no transition.
Constructor Summary | |
---|---|
CharRegexTable(int firstState,
int[][] transitions,
boolean[] accepts)
Build a RegexTable with firstState as first state, transitions as transition table as explained in CharRegexTable , and accepts which gives accepting states |
Method Summary | |
---|---|
boolean |
accept(int i)
Tests if the state is or not an accept state. |
int |
getStart()
Returns the index of the start state. |
int |
getStateNumber()
Returns the number of state of the whole automaton. |
int |
getTransition(int state,
int next)
Returns the index of the following state from the state state with the letter next. |
boolean |
noOut(int currentState)
Returns if the state pass as srgument is a sink state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CharRegexTable(int firstState, int[][] transitions, boolean[] accepts)
CharRegexTable
, and accepts which gives accepting states
firstState
- the first statetransitions
- transition table as explained in CharRegexTable
accepts
- accepting statesMethod Detail |
---|
public boolean accept(int i)
RegexTable
accept
in interface RegexTable
i
- the state
public int getStart()
RegexTable
getStart
in interface RegexTable
public int getStateNumber()
RegexTable
getStateNumber
in interface RegexTable
public int getTransition(int state, int next)
RegexTable
getTransition
in interface RegexTable
state
- previous statenext
- letter to read
public boolean noOut(int currentState)
RegexTable
noOut
in interface RegexTable
currentState
- the state
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |