Class ParserTokenManager
- java.lang.Object
-
- org.apache.velocity.runtime.parser.ParserTokenManager
-
- All Implemented Interfaces:
ParserConstants
public class ParserTokenManager extends java.lang.Object implements ParserConstants
Token Manager.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classParserTokenManager.ParserStateHolds the state of the parsing process.
-
Field Summary
Fields Modifier and Type Field Description protected charcurChar(package private) intcurLexStatebooleandebugPrintjava.io.PrintStreamdebugStreamDebug output.(package private) intdefaultLexStateprivate intfileDepthprivate org.apache.commons.lang3.text.StrBuilderimageprivate booleaninCommentbooleaninDirectiveprotected CharStreaminput_streamprivate booleaninReferencebooleaninSet(package private) static long[]jjbitVec0(package private) static long[]jjbitVec2private org.apache.commons.lang3.text.StrBuilderjjimageprivate intjjimageLen(package private) intjjmatchedKind(package private) intjjmatchedPosstatic int[]jjnewLexStateLex State array.(package private) intjjnewStateCnt(package private) static int[]jjnextStates(package private) intjjroundprivate int[]jjroundsprivate int[]jjstateSetstatic java.lang.String[]jjstrLiteralImagesToken literal values.(package private) static long[]jjtoMore(package private) static long[]jjtoSkip(package private) static long[]jjtoSpecial(package private) static long[]jjtoTokenprivate intlengthOfMatchstatic java.lang.String[]lexStateNamesLexer state names.private intlparenprivate intrparen(package private) java.util.ListstateStack-
Fields inherited from interface org.apache.velocity.runtime.parser.ParserConstants
ALPHA_CHAR, ALPHANUM_CHAR, BRACKETED_WORD, COLON, COMMA, DEFAULT, DIGIT, DIRECTIVE, DIRECTIVE_CHAR, DIRECTIVE_TERMINATOR, DIVIDE, DOLLAR, DOLLARBANG, DOT, DOUBLE_ESCAPE, DOUBLEDOT, ELSE_DIRECTIVE, ELSEIF_DIRECTIVE, EMPTY_INDEX, END, EOF, EQUALS, ESCAPE, ESCAPE_DIRECTIVE, EXPONENT, FALSE, FLOATING_POINT_LITERAL, FORMAL_COMMENT, HASH, IDENTIFIER, IDENTIFIER_CHAR, IF_DIRECTIVE, IN_FORMAL_COMMENT, IN_MULTI_LINE_COMMENT, IN_SINGLE_LINE_COMMENT, IN_TEXTBLOCK, INDEX_LBRACKET, INDEX_RBRACKET, INTEGER_LITERAL, LBRACKET, LCURLY, LEFT_CURLEY, LETTER, LOGICAL_AND, LOGICAL_EQUALS, LOGICAL_GE, LOGICAL_GT, LOGICAL_LE, LOGICAL_LT, LOGICAL_NOT, LOGICAL_NOT_EQUALS, LOGICAL_OR, LPAREN, MINUS, MODULUS, MULTI_LINE_COMMENT, MULTIPLY, NEWLINE, PLUS, PRE_DIRECTIVE, RBRACKET, RCURLY, REFERENCE, REFERENCE_TERMINATOR, REFINDEX, REFMOD, REFMOD2, REFMOD2_RPAREN, REFMODIFIER, RIGHT_CURLEY, RPAREN, SET_DIRECTIVE, SINGLE_LINE_COMMENT, SINGLE_LINE_COMMENT_START, STRING_LITERAL, TEXT, TEXTBLOCK, tokenImage, TRUE, WHITESPACE, WORD
-
-
Constructor Summary
Constructors Constructor Description ParserTokenManager(CharStream stream)Constructor.ParserTokenManager(CharStream stream, int lexState)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearStateVars()Clears all state variables, resets to start values, clears stateStack.TokengetNextToken()Get the next Token.private voidjjAddStates(int start, int end)private static booleanjjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)private voidjjCheckNAdd(int state)private voidjjCheckNAddStates(int start, int end)private voidjjCheckNAddTwoStates(int state1, int state2)protected TokenjjFillToken()private intjjMoveNfa_0(int startState, int curPos)private intjjMoveNfa_1(int startState, int curPos)private intjjMoveNfa_10(int startState, int curPos)private intjjMoveNfa_11(int startState, int curPos)private intjjMoveNfa_2(int startState, int curPos)private intjjMoveNfa_3(int startState, int curPos)private intjjMoveNfa_4(int startState, int curPos)private intjjMoveNfa_5(int startState, int curPos)private intjjMoveNfa_6(int startState, int curPos)private intjjMoveNfa_7(int startState, int curPos)private intjjMoveNfa_8(int startState, int curPos)private intjjMoveNfa_9(int startState, int curPos)private intjjMoveStringLiteralDfa0_0()private intjjMoveStringLiteralDfa0_1()private intjjMoveStringLiteralDfa0_10()private intjjMoveStringLiteralDfa0_11()private intjjMoveStringLiteralDfa0_2()private intjjMoveStringLiteralDfa0_3()private intjjMoveStringLiteralDfa0_4()private intjjMoveStringLiteralDfa0_5()private intjjMoveStringLiteralDfa0_6()private intjjMoveStringLiteralDfa0_7()private intjjMoveStringLiteralDfa0_8()private intjjMoveStringLiteralDfa0_9()private intjjMoveStringLiteralDfa1_0(long active0)private intjjMoveStringLiteralDfa1_1(long active0)private intjjMoveStringLiteralDfa1_10(long active0)private intjjMoveStringLiteralDfa1_11(long active0)private intjjMoveStringLiteralDfa1_2(long active0)private intjjMoveStringLiteralDfa1_3(long active0)private intjjMoveStringLiteralDfa1_4(long active0)private intjjMoveStringLiteralDfa1_5(long active0)private intjjMoveStringLiteralDfa1_6(long active0)private intjjMoveStringLiteralDfa1_7(long active0)private intjjMoveStringLiteralDfa1_8(long active0)private intjjMoveStringLiteralDfa1_9(long active0)private intjjMoveStringLiteralDfa2_0(long old0, long active0)private intjjMoveStringLiteralDfa2_1(long old0, long active0)private intjjMoveStringLiteralDfa2_10(long old0, long active0)private intjjMoveStringLiteralDfa2_11(long old0, long active0)private intjjMoveStringLiteralDfa2_2(long old0, long active0)private intjjMoveStringLiteralDfa2_3(long old0, long active0)private intjjMoveStringLiteralDfa2_4(long old0, long active0)private intjjMoveStringLiteralDfa2_5(long old0, long active0)private intjjMoveStringLiteralDfa2_6(long old0, long active0)private intjjMoveStringLiteralDfa2_7(long old0, long active0)private intjjMoveStringLiteralDfa2_8(long old0, long active0)private intjjMoveStringLiteralDfa2_9(long old0, long active0)private intjjMoveStringLiteralDfa3_0(long old0, long active0)private intjjMoveStringLiteralDfa3_1(long old0, long active0)private intjjMoveStringLiteralDfa3_2(long old0, long active0)private intjjMoveStringLiteralDfa3_3(long old0, long active0)private intjjMoveStringLiteralDfa3_4(long old0, long active0)private intjjMoveStringLiteralDfa4_0(long old0, long active0)private intjjMoveStringLiteralDfa4_1(long old0, long active0)private intjjMoveStringLiteralDfa4_2(long old0, long active0)private intjjMoveStringLiteralDfa4_3(long old0, long active0)private intjjMoveStringLiteralDfa4_4(long old0, long active0)private intjjStartNfa_0(int pos, long active0, long active1)private intjjStartNfa_1(int pos, long active0, long active1)private intjjStartNfa_10(int pos, long active0)private intjjStartNfa_11(int pos, long active0)private intjjStartNfa_2(int pos, long active0)private intjjStartNfa_3(int pos, long active0)private intjjStartNfa_4(int pos, long active0)private intjjStartNfa_5(int pos, long active0)private intjjStartNfa_6(int pos, long active0)private intjjStartNfa_7(int pos, long active0)private intjjStartNfa_8(int pos, long active0)private intjjStartNfa_9(int pos, long active0)private intjjStartNfaWithStates_0(int pos, int kind, int state)private intjjStartNfaWithStates_1(int pos, int kind, int state)private intjjStartNfaWithStates_10(int pos, int kind, int state)private intjjStartNfaWithStates_11(int pos, int kind, int state)private intjjStartNfaWithStates_2(int pos, int kind, int state)private intjjStartNfaWithStates_3(int pos, int kind, int state)private intjjStartNfaWithStates_4(int pos, int kind, int state)private intjjStartNfaWithStates_5(int pos, int kind, int state)private intjjStartNfaWithStates_6(int pos, int kind, int state)private intjjStartNfaWithStates_7(int pos, int kind, int state)private intjjStartNfaWithStates_8(int pos, int kind, int state)private intjjStartNfaWithStates_9(int pos, int kind, int state)private intjjStopAtPos(int pos, int kind)private intjjStopStringLiteralDfa_0(int pos, long active0, long active1)private intjjStopStringLiteralDfa_1(int pos, long active0, long active1)private intjjStopStringLiteralDfa_10(int pos, long active0)private intjjStopStringLiteralDfa_11(int pos, long active0)private intjjStopStringLiteralDfa_2(int pos, long active0)private intjjStopStringLiteralDfa_3(int pos, long active0)private intjjStopStringLiteralDfa_4(int pos, long active0)private intjjStopStringLiteralDfa_5(int pos, long active0)private intjjStopStringLiteralDfa_6(int pos, long active0)private intjjStopStringLiteralDfa_7(int pos, long active0)private intjjStopStringLiteralDfa_8(int pos, long active0)private intjjStopStringLiteralDfa_9(int pos, long active0)(package private) voidMoreLexicalActions()voidReInit(CharStream stream)Reinitialise parser.voidReInit(CharStream stream, int lexState)Reinitialise parser.private voidReInitRounds()private voidRPARENHandler()handles the dropdown logic when encountering a RPARENvoidsetDebugStream(java.io.PrintStream ds)Set debug output.(package private) voidSkipLexicalActions(Token matchedToken)booleanstateStackPop()pushes the current state onto the 'state stack', and maintains the parens counts public because we need it in PD & VM handlingbooleanstateStackPush()pops a state off the stack, and restores paren countsvoidSwitchTo(int lexState)Switch to specified lex state.(package private) voidTokenLexicalActions(Token matchedToken)
-
-
-
Field Detail
-
fileDepth
private int fileDepth
-
lparen
private int lparen
-
rparen
private int rparen
-
stateStack
java.util.List stateStack
-
debugPrint
public boolean debugPrint
-
inReference
private boolean inReference
-
inDirective
public boolean inDirective
-
inComment
private boolean inComment
-
inSet
public boolean inSet
-
debugStream
public java.io.PrintStream debugStream
Debug output.
-
jjbitVec0
static final long[] jjbitVec0
-
jjbitVec2
static final long[] jjbitVec2
-
jjnextStates
static final int[] jjnextStates
-
jjstrLiteralImages
public static final java.lang.String[] jjstrLiteralImages
Token literal values.
-
lexStateNames
public static final java.lang.String[] lexStateNames
Lexer state names.
-
jjnewLexState
public static final int[] jjnewLexState
Lex State array.
-
jjtoToken
static final long[] jjtoToken
-
jjtoSkip
static final long[] jjtoSkip
-
jjtoSpecial
static final long[] jjtoSpecial
-
jjtoMore
static final long[] jjtoMore
-
input_stream
protected CharStream input_stream
-
jjrounds
private final int[] jjrounds
-
jjstateSet
private final int[] jjstateSet
-
jjimage
private final org.apache.commons.lang3.text.StrBuilder jjimage
-
image
private org.apache.commons.lang3.text.StrBuilder image
-
jjimageLen
private int jjimageLen
-
lengthOfMatch
private int lengthOfMatch
-
curChar
protected char curChar
-
curLexState
int curLexState
-
defaultLexState
int defaultLexState
-
jjnewStateCnt
int jjnewStateCnt
-
jjround
int jjround
-
jjmatchedPos
int jjmatchedPos
-
jjmatchedKind
int jjmatchedKind
-
-
Constructor Detail
-
ParserTokenManager
public ParserTokenManager(CharStream stream)
Constructor.
-
ParserTokenManager
public ParserTokenManager(CharStream stream, int lexState)
Constructor.
-
-
Method Detail
-
stateStackPop
public boolean stateStackPop()
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 :)
-
stateStackPush
public boolean stateStackPush()
pops a state off the stack, and restores paren counts- Returns:
- boolean : success of operation
-
clearStateVars
public void clearStateVars()
Clears all state variables, resets to start values, clears stateStack. Call before parsing.
-
RPARENHandler
private void RPARENHandler()
handles the dropdown logic when encountering a RPAREN
-
setDebugStream
public void setDebugStream(java.io.PrintStream ds)
Set debug output.
-
jjStopStringLiteralDfa_3
private final int jjStopStringLiteralDfa_3(int pos, long active0)
-
jjStartNfa_3
private final int jjStartNfa_3(int pos, long active0)
-
jjStopAtPos
private int jjStopAtPos(int pos, int kind)
-
jjMoveStringLiteralDfa0_3
private int jjMoveStringLiteralDfa0_3()
-
jjMoveStringLiteralDfa1_3
private int jjMoveStringLiteralDfa1_3(long active0)
-
jjMoveStringLiteralDfa2_3
private int jjMoveStringLiteralDfa2_3(long old0, long active0)
-
jjMoveStringLiteralDfa3_3
private int jjMoveStringLiteralDfa3_3(long old0, long active0)
-
jjMoveStringLiteralDfa4_3
private int jjMoveStringLiteralDfa4_3(long old0, long active0)
-
jjStartNfaWithStates_3
private int jjStartNfaWithStates_3(int pos, int kind, int state)
-
jjMoveNfa_3
private int jjMoveNfa_3(int startState, int curPos)
-
jjStopStringLiteralDfa_11
private final int jjStopStringLiteralDfa_11(int pos, long active0)
-
jjStartNfa_11
private final int jjStartNfa_11(int pos, long active0)
-
jjMoveStringLiteralDfa0_11
private int jjMoveStringLiteralDfa0_11()
-
jjMoveStringLiteralDfa1_11
private int jjMoveStringLiteralDfa1_11(long active0)
-
jjMoveStringLiteralDfa2_11
private int jjMoveStringLiteralDfa2_11(long old0, long active0)
-
jjStartNfaWithStates_11
private int jjStartNfaWithStates_11(int pos, int kind, int state)
-
jjMoveNfa_11
private int jjMoveNfa_11(int startState, int curPos)
-
jjStopStringLiteralDfa_8
private final int jjStopStringLiteralDfa_8(int pos, long active0)
-
jjStartNfa_8
private final int jjStartNfa_8(int pos, long active0)
-
jjMoveStringLiteralDfa0_8
private int jjMoveStringLiteralDfa0_8()
-
jjMoveStringLiteralDfa1_8
private int jjMoveStringLiteralDfa1_8(long active0)
-
jjMoveStringLiteralDfa2_8
private int jjMoveStringLiteralDfa2_8(long old0, long active0)
-
jjStartNfaWithStates_8
private int jjStartNfaWithStates_8(int pos, int kind, int state)
-
jjMoveNfa_8
private int jjMoveNfa_8(int startState, int curPos)
-
jjStopStringLiteralDfa_6
private final int jjStopStringLiteralDfa_6(int pos, long active0)
-
jjStartNfa_6
private final int jjStartNfa_6(int pos, long active0)
-
jjMoveStringLiteralDfa0_6
private int jjMoveStringLiteralDfa0_6()
-
jjMoveStringLiteralDfa1_6
private int jjMoveStringLiteralDfa1_6(long active0)
-
jjMoveStringLiteralDfa2_6
private int jjMoveStringLiteralDfa2_6(long old0, long active0)
-
jjStartNfaWithStates_6
private int jjStartNfaWithStates_6(int pos, int kind, int state)
-
jjMoveNfa_6
private int jjMoveNfa_6(int startState, int curPos)
-
jjStopStringLiteralDfa_5
private final int jjStopStringLiteralDfa_5(int pos, long active0)
-
jjStartNfa_5
private final int jjStartNfa_5(int pos, long active0)
-
jjMoveStringLiteralDfa0_5
private int jjMoveStringLiteralDfa0_5()
-
jjMoveStringLiteralDfa1_5
private int jjMoveStringLiteralDfa1_5(long active0)
-
jjMoveStringLiteralDfa2_5
private int jjMoveStringLiteralDfa2_5(long old0, long active0)
-
jjStartNfaWithStates_5
private int jjStartNfaWithStates_5(int pos, int kind, int state)
-
jjMoveNfa_5
private int jjMoveNfa_5(int startState, int curPos)
-
jjStopStringLiteralDfa_9
private final int jjStopStringLiteralDfa_9(int pos, long active0)
-
jjStartNfa_9
private final int jjStartNfa_9(int pos, long active0)
-
jjMoveStringLiteralDfa0_9
private int jjMoveStringLiteralDfa0_9()
-
jjMoveStringLiteralDfa1_9
private int jjMoveStringLiteralDfa1_9(long active0)
-
jjMoveStringLiteralDfa2_9
private int jjMoveStringLiteralDfa2_9(long old0, long active0)
-
jjStartNfaWithStates_9
private int jjStartNfaWithStates_9(int pos, int kind, int state)
-
jjMoveNfa_9
private int jjMoveNfa_9(int startState, int curPos)
-
jjStopStringLiteralDfa_2
private final int jjStopStringLiteralDfa_2(int pos, long active0)
-
jjStartNfa_2
private final int jjStartNfa_2(int pos, long active0)
-
jjMoveStringLiteralDfa0_2
private int jjMoveStringLiteralDfa0_2()
-
jjMoveStringLiteralDfa1_2
private int jjMoveStringLiteralDfa1_2(long active0)
-
jjMoveStringLiteralDfa2_2
private int jjMoveStringLiteralDfa2_2(long old0, long active0)
-
jjMoveStringLiteralDfa3_2
private int jjMoveStringLiteralDfa3_2(long old0, long active0)
-
jjMoveStringLiteralDfa4_2
private int jjMoveStringLiteralDfa4_2(long old0, long active0)
-
jjStartNfaWithStates_2
private int jjStartNfaWithStates_2(int pos, int kind, int state)
-
jjMoveNfa_2
private int jjMoveNfa_2(int startState, int curPos)
-
jjStopStringLiteralDfa_10
private final int jjStopStringLiteralDfa_10(int pos, long active0)
-
jjStartNfa_10
private final int jjStartNfa_10(int pos, long active0)
-
jjMoveStringLiteralDfa0_10
private int jjMoveStringLiteralDfa0_10()
-
jjMoveStringLiteralDfa1_10
private int jjMoveStringLiteralDfa1_10(long active0)
-
jjMoveStringLiteralDfa2_10
private int jjMoveStringLiteralDfa2_10(long old0, long active0)
-
jjStartNfaWithStates_10
private int jjStartNfaWithStates_10(int pos, int kind, int state)
-
jjMoveNfa_10
private int jjMoveNfa_10(int startState, int curPos)
-
jjStopStringLiteralDfa_0
private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1)
-
jjStartNfa_0
private final int jjStartNfa_0(int pos, long active0, long active1)
-
jjMoveStringLiteralDfa0_0
private int jjMoveStringLiteralDfa0_0()
-
jjMoveStringLiteralDfa1_0
private int jjMoveStringLiteralDfa1_0(long active0)
-
jjMoveStringLiteralDfa2_0
private int jjMoveStringLiteralDfa2_0(long old0, long active0)
-
jjMoveStringLiteralDfa3_0
private int jjMoveStringLiteralDfa3_0(long old0, long active0)
-
jjMoveStringLiteralDfa4_0
private int jjMoveStringLiteralDfa4_0(long old0, long active0)
-
jjStartNfaWithStates_0
private int jjStartNfaWithStates_0(int pos, int kind, int state)
-
jjMoveNfa_0
private int jjMoveNfa_0(int startState, int curPos)
-
jjStopStringLiteralDfa_4
private final int jjStopStringLiteralDfa_4(int pos, long active0)
-
jjStartNfa_4
private final int jjStartNfa_4(int pos, long active0)
-
jjMoveStringLiteralDfa0_4
private int jjMoveStringLiteralDfa0_4()
-
jjMoveStringLiteralDfa1_4
private int jjMoveStringLiteralDfa1_4(long active0)
-
jjMoveStringLiteralDfa2_4
private int jjMoveStringLiteralDfa2_4(long old0, long active0)
-
jjMoveStringLiteralDfa3_4
private int jjMoveStringLiteralDfa3_4(long old0, long active0)
-
jjMoveStringLiteralDfa4_4
private int jjMoveStringLiteralDfa4_4(long old0, long active0)
-
jjStartNfaWithStates_4
private int jjStartNfaWithStates_4(int pos, int kind, int state)
-
jjMoveNfa_4
private int jjMoveNfa_4(int startState, int curPos)
-
jjStopStringLiteralDfa_1
private final int jjStopStringLiteralDfa_1(int pos, long active0, long active1)
-
jjStartNfa_1
private final int jjStartNfa_1(int pos, long active0, long active1)
-
jjMoveStringLiteralDfa0_1
private int jjMoveStringLiteralDfa0_1()
-
jjMoveStringLiteralDfa1_1
private int jjMoveStringLiteralDfa1_1(long active0)
-
jjMoveStringLiteralDfa2_1
private int jjMoveStringLiteralDfa2_1(long old0, long active0)
-
jjMoveStringLiteralDfa3_1
private int jjMoveStringLiteralDfa3_1(long old0, long active0)
-
jjMoveStringLiteralDfa4_1
private int jjMoveStringLiteralDfa4_1(long old0, long active0)
-
jjStartNfaWithStates_1
private int jjStartNfaWithStates_1(int pos, int kind, int state)
-
jjMoveNfa_1
private int jjMoveNfa_1(int startState, int curPos)
-
jjStopStringLiteralDfa_7
private final int jjStopStringLiteralDfa_7(int pos, long active0)
-
jjStartNfa_7
private final int jjStartNfa_7(int pos, long active0)
-
jjMoveStringLiteralDfa0_7
private int jjMoveStringLiteralDfa0_7()
-
jjMoveStringLiteralDfa1_7
private int jjMoveStringLiteralDfa1_7(long active0)
-
jjMoveStringLiteralDfa2_7
private int jjMoveStringLiteralDfa2_7(long old0, long active0)
-
jjStartNfaWithStates_7
private int jjStartNfaWithStates_7(int pos, int kind, int state)
-
jjMoveNfa_7
private int jjMoveNfa_7(int startState, int curPos)
-
jjCanMove_0
private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
-
ReInit
public void ReInit(CharStream stream)
Reinitialise parser.
-
ReInitRounds
private void ReInitRounds()
-
ReInit
public void ReInit(CharStream stream, int lexState)
Reinitialise parser.
-
SwitchTo
public void SwitchTo(int lexState)
Switch to specified lex state.
-
jjFillToken
protected Token jjFillToken()
-
getNextToken
public Token getNextToken()
Get the next Token.
-
SkipLexicalActions
void SkipLexicalActions(Token matchedToken)
-
MoreLexicalActions
void MoreLexicalActions()
-
TokenLexicalActions
void TokenLexicalActions(Token matchedToken)
-
jjCheckNAdd
private void jjCheckNAdd(int state)
-
jjAddStates
private void jjAddStates(int start, int end)
-
jjCheckNAddTwoStates
private void jjCheckNAddTwoStates(int state1, int state2)
-
jjCheckNAddStates
private void jjCheckNAddStates(int start, int end)
-
-