Class NfaState

java.lang.Object
org.javacc.parser.NfaState

class NfaState extends Object
The state of a Non-deterministic Finite Automaton.
  • Field Details

    • asciiMoves

      private final long[] asciiMoves
    • rangeMoves

      private char[] rangeMoves
    • epsilonMovesString

      private String epsilonMovesString
    • epsilonMoveArray

      private NfaState[] epsilonMoveArray
    • id

      private final int id
    • lexerContext

      private final LexerContext 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

      private final Set<NfaState> compositeStateSet
    • onlyChar

      private int onlyChar
    • matchSingleChar

      private char matchSingleChar
    • charMoves

      char[] charMoves
    • next

      NfaState next
    • epsilonMoves

      Vector<NfaState> epsilonMoves
    • stateName

      int stateName
    • kind

      int kind
    • inNextOf

      int inNextOf
    • isFinal

      boolean isFinal
    • closureDone

      private boolean closureDone
  • Constructor Details

  • Method Details

    • CreateClone

      private NfaState CreateClone()
    • InsertInOrder

      private static void InsertInOrder(List<NfaState> v, NfaState s)
    • ExpandCharArr

      private static char[] ExpandCharArr(char[] oldArr, int incr)
    • AddMove

      void AddMove(NfaState newState)
    • 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

      private void MergeMoves(NfaState other)
    • CreateEquivState

      private NfaState CreateEquivState(List<NfaState> states)
    • GetEquivalentRunTimeState

      private NfaState GetEquivalentRunTimeState()
    • GenerateCode

      void GenerateCode()
    • ComputeClosures

      static void ComputeClosures(LexerContext lexerContext)
    • OptimizeEpsilonMoves

      private void OptimizeEpsilonMoves(boolean optReqd, LexerContext lexerContext)
    • GenerateNextStatesCode

      private void GenerateNextStatesCode()
    • GetEpsilonMovesString

      private String GetEpsilonMovesString()
    • CanMoveUsingChar

      private final boolean CanMoveUsingChar(char c)
    • MoveFrom

      private int MoveFrom(char c, List<NfaState> newStates)
    • MoveFromSet

      static int MoveFromSet(char c, List<NfaState> states, List<NfaState> newStates)
    • AddStartStateSet

      static int AddStartStateSet(String stateSetString, LexerContext lexerContext)
    • AddCompositeStateSet

      private static int AddCompositeStateSet(String stateSetString, LexerContext lexerContext, boolean starts)
    • GenerateInitMoves

      int GenerateInitMoves()
    • GetStateSetString

      static String GetStateSetString(List<NfaState> states, LexerContext lexerContext)
    • ElemOccurs

      private static int ElemOccurs(int elem, int[] arr)
    • Intersect

      private static boolean Intersect(String set1, String set2, LexerContext lexerContext)
    • UpdateNfaData

      static void UpdateNfaData(int maxState, int startStateName, int lexicalStateIndex, int matchAnyCharKind, LexerContext lexerContext)
    • BuildTokenizerData

      static void BuildTokenizerData(TokenizerData tokenizerData, LexerContext lexerContext)
    • getNfaState

      static NfaState getNfaState(int index, LexerContext lexerContext)