Class NfaState
java.lang.Object
org.javacc.parser.NfaState
The state of a Non-deterministic Finite Automaton.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final long[](package private) char[]private booleanprivate int[]private NfaState[]private Stringprivate final int(package private) intprivate boolean(package private) boolean(package private) intprivate intprivate final LexerContextprivate intprivate intprivate char(package private) NfaStateprivate intprivate char[](package private) intprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate final voidAddASCIIMove(char c) (package private) voidAddChar(char c) private static intAddCompositeStateSet(String stateSetString, LexerContext lexerContext, boolean starts) (package private) void(package private) voidAddRange(char left, char right) (package private) static intAddStartStateSet(String stateSetString, LexerContext lexerContext) (package private) static voidBuildTokenizerData(TokenizerData tokenizerData, LexerContext lexerContext) private final booleanCanMoveUsingChar(char c) (package private) static voidComputeClosures(LexerContext lexerContext) private NfaStateprivate NfaStateCreateEquivState(List<NfaState> states) private static intElemOccurs(int elem, int[] arr) private voidThis function computes the closure and also updates the kind so that any time there is a move to this state, it can go on epsilon to a new state in the epsilon moves that might have a lower kind of token number for the same length.private static booleanEqualCharArr(char[] arr1, char[] arr2) private static char[]ExpandCharArr(char[] oldArr, int incr) (package private) void(package private) intprivate voidprivate Stringprivate NfaState(package private) static NfaStategetNfaState(int index, LexerContext lexerContext) (package private) static StringGetStateSetString(List<NfaState> states, LexerContext lexerContext) private booleanprivate static voidInsertInOrder(List<NfaState> v, NfaState s) private static booleanIntersect(String set1, String set2, LexerContext lexerContext) private voidMergeMoves(NfaState other) private int(package private) static intMoveFromSet(char c, List<NfaState> states, List<NfaState> newStates) private voidOptimizeEpsilonMoves(boolean optReqd, LexerContext lexerContext) (package private) static voidUpdateNfaData(int maxState, int startStateName, int lexicalStateIndex, int matchAnyCharKind, LexerContext lexerContext) private boolean
-
Field Details
-
asciiMoves
private final long[] asciiMoves -
rangeMoves
private char[] rangeMoves -
epsilonMovesString
-
epsilonMoveArray
-
id
private final int id -
lexerContext
-
lookingFor
private int lookingFor -
usefulEpsilonMoves
private int usefulEpsilonMoves -
lexState
private int lexState -
kindToPrint
private int kindToPrint -
isComposite
private boolean isComposite -
compositeStates
private int[] compositeStates -
compositeStateSet
-
onlyChar
private int onlyChar -
matchSingleChar
private char matchSingleChar -
charMoves
char[] charMoves -
next
NfaState next -
epsilonMoves
-
stateName
int stateName -
kind
int kind -
inNextOf
int inNextOf -
isFinal
boolean isFinal -
closureDone
private boolean closureDone
-
-
Constructor Details
-
NfaState
-
-
Method Details
-
CreateClone
-
InsertInOrder
-
ExpandCharArr
private static char[] ExpandCharArr(char[] oldArr, int incr) -
AddMove
-
AddASCIIMove
private final void AddASCIIMove(char c) -
AddChar
void AddChar(char c) -
AddRange
void AddRange(char left, char right) -
EqualCharArr
private static boolean EqualCharArr(char[] arr1, char[] arr2) -
EpsilonClosure
private void EpsilonClosure()This function computes the closure and also updates the kind so that any time there is a move to this state, it can go on epsilon to a new state in the epsilon moves that might have a lower kind of token number for the same length. -
UsefulState
private boolean UsefulState() -
HasTransitions
private boolean HasTransitions() -
MergeMoves
-
CreateEquivState
-
GetEquivalentRunTimeState
-
GenerateCode
void GenerateCode() -
ComputeClosures
-
OptimizeEpsilonMoves
-
GenerateNextStatesCode
private void GenerateNextStatesCode() -
GetEpsilonMovesString
-
CanMoveUsingChar
private final boolean CanMoveUsingChar(char c) -
MoveFrom
-
MoveFromSet
-
AddStartStateSet
-
AddCompositeStateSet
private static int AddCompositeStateSet(String stateSetString, LexerContext lexerContext, boolean starts) -
GenerateInitMoves
int GenerateInitMoves() -
GetStateSetString
-
ElemOccurs
private static int ElemOccurs(int elem, int[] arr) -
Intersect
-
UpdateNfaData
static void UpdateNfaData(int maxState, int startStateName, int lexicalStateIndex, int matchAnyCharKind, LexerContext lexerContext) -
BuildTokenizerData
-
getNfaState
-