org.apache.velocity.runtime.parser
Class ParserTokenManager

java.lang.Object
  extended by org.apache.velocity.runtime.parser.ParserTokenManager
All Implemented Interfaces:
ParserConstants

public class ParserTokenManager
extends Object
implements ParserConstants

Token Manager.


Field Summary
protected  char curChar
           
 boolean debugPrint
           
 PrintStream debugStream
          Debug output.
 boolean inDirective
           
protected  CharStream input_stream
           
 boolean inSet
           
static int[] jjnewLexState
          Lex State array.
static String[] jjstrLiteralImages
          Token literal values.
static String[] lexStateNames
          Lexer state names.
 
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
ParserTokenManager(CharStream stream)
          Constructor.
ParserTokenManager(CharStream stream, int lexState)
          Constructor.
 
Method Summary
 void clearStateVars()
          Clears all state variables, resets to start values, clears stateStack.
 Token getNextToken()
          Get the next Token.
protected  Token jjFillToken()
           
 void ReInit(CharStream stream)
          Reinitialise parser.
 void ReInit(CharStream stream, int lexState)
          Reinitialise parser.
 void setDebugStream(PrintStream ds)
          Set debug output.
 boolean stateStackPop()
          pushes the current state onto the 'state stack', and maintains the parens counts public because we need it in PD & VM handling
 boolean stateStackPush()
          pops a state off the stack, and restores paren counts
 void SwitchTo(int lexState)
          Switch to specified lex state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugPrint

public boolean debugPrint

inDirective

public boolean inDirective

inSet

public boolean inSet

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.


input_stream

protected CharStream input_stream

curChar

protected char curChar
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.


setDebugStream

public void setDebugStream(PrintStream ds)
Set debug output.


ReInit

public void ReInit(CharStream stream)
Reinitialise parser.


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.



Copyright © 2000-2012 The Apache Software Foundation. All Rights Reserved.