Class StandardParserTokenManager

    • Field Detail

      • debugStream

        public PrintStream debugStream
        Debug output.
      • jjstrLiteralImages

        public static final String[] jjstrLiteralImages
        Token literal values.
      • lexStateNames

        public static final String[] lexStateNames
        Lexer state names.
      • jjnewLexState

        public static final int[] jjnewLexState
        Lex State array.
      • curChar

        protected int curChar
    • Constructor Detail

      • StandardParserTokenManager

        public StandardParserTokenManager​(StandardParser parserArg,
                                          CharStream stream)
        Constructor with parser.
      • StandardParserTokenManager

        public StandardParserTokenManager​(StandardParser parserArg,
                                          CharStream stream,
                                          int lexState)
        Constructor with parser.
    • Method Detail

      • trace

        public static void trace​(String message)
        Our own trace method. Use sparsingly in production, since each and every call will introduce an execution branch and slow down parsing.
      • switchTo

        public void switchTo​(int lexState)
        Switches to a new state (add some log to the default method)
      • getCurrentLexicalState

        public int getCurrentLexicalState()
      • stateStackPop

        public boolean stateStackPop()
        pops a state off the stack, and restores paren counts
        Returns:
        boolean : success of operation
      • stateStackPush

        public boolean stateStackPush()
        pushes the current state onto the 'state stack', and maintains the parens counts public because we need it in PD & VM handling
        Returns:
        boolean : success. It can fail if the state machine gets messed up (do don't mess it up :)
      • clearStateVars

        public void clearStateVars()
        Clears all state variables, resets to start values, clears stateStack. Call before parsing.
      • setInSet

        public void setInSet​(boolean value)
      • isInSet

        public boolean isInSet()
      • setDebugStream

        public void setDebugStream​(PrintStream ds)
        Set debug output.
      • jjFillToken

        protected Token jjFillToken()
      • getNextToken

        public Token getNextToken()
        Get the next Token.
      • SwitchTo

        public void SwitchTo​(int lexState)
        Switch to specified lex state.