public class VmParser extends Object implements VmParserTreeConstants, VmParserConstants
| Modifier and Type | Field and Description |
|---|---|
String |
currentTemplateName
Name of current template we are parsing.
|
Token |
jj_nt
Next token.
|
protected JJTVmParserState |
jjtree |
boolean |
strictEscape
Set to true if the property
RuntimeConstants.RUNTIME_REFERENCES_STRICT_ESCAPE is set to true
|
Token |
token
Current token.
|
VmParserTokenManager |
token_source
Generated Token Manager.
|
JJTADDNODE, JJTANDNODE, JJTASSIGNMENT, JJTBLOCK, JJTCOMMENT, JJTDIRECTIVE, JJTDIVNODE, JJTELSEIFSTATEMENT, JJTELSESTATEMENT, JJTEQNODE, JJTESCAPE, JJTESCAPEDDIRECTIVE, JJTEXPRESSION, JJTFALSE, JJTFLOATINGPOINTLITERAL, JJTFOREACHSTATEMENT, JJTGENODE, JJTGTNODE, JJTIDENTIFIER, JJTIFSTATEMENT, JJTINDEX, JJTINTEGERLITERAL, JJTINTEGERRANGE, JJTLENODE, JJTLTNODE, JJTMAP, JJTMETHOD, JJTMODNODE, JJTMULNODE, JJTNENODE, jjtNodeName, JJTNOTNODE, JJTOBJECTARRAY, JJTORNODE, JJTPROCESS, JJTREFERENCE, JJTSETDIRECTIVE, JJTSTRINGLITERAL, JJTSUBTRACTNODE, JJTTEXT, JJTTEXTBLOCK, JJTTRUE, JJTVOID, JJTWORDALPHA_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, FOREACH_DIRECTIVE, FORMAL_COMMENT, HASH, IDENTIFIER, IDENTIFIER_CHAR, IF_DIRECTIVE, IN, 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 and Description |
|---|
VmParser(CharStream stream)
Constructor with user supplied CharStream.
|
VmParser(VmParserTokenManager tm)
Constructor with generated Token Manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
AdditiveExpression() |
void |
Assignment() |
void |
Comment() |
void |
ConditionalAndExpression() |
void |
ConditionalOrExpression() |
VmNode |
Directive()
Supports the Pluggable Directives
#foo( arg+ )
|
int |
DirectiveArg()
Supports the arguments for the Pluggable Directives
|
void |
disable_tracing()
Disable tracing.
|
void |
ElseIfStatement() |
void |
ElseStatement() |
void |
enable_tracing()
Enable tracing.
|
void |
EqualityExpression() |
void |
Escape()
Used to catch and process escape sequences in grammatical constructs
as escapes outside of VTL are just characters.
|
void |
EscapedDirective()
used to separate the notion of a valid directive that has been
escaped, versus something that looks like a directive and
is just schmoo.
|
void |
Expression() |
void |
False() |
void |
FloatingPointLiteral() |
void |
ForeachStatement() |
ParseException |
generateParseException()
Generate ParseException.
|
Directive |
getDirective(String directive)
This method gets a Directive from the directives Hashtable
|
Token |
getNextToken()
Get the next Token.
|
Token |
getToken(int index)
Get the specific Token.
|
void |
Identifier()
This method corresponds to variable
references in Velocity templates.
|
void |
IfStatement() |
void |
Index() |
void |
IndexParameter()
A Simplified parameter more suitable for an index position: $foo[$index]
|
void |
IntegerLiteral() |
void |
IntegerRange()
supports the [n..m] vector generator for use in
the #foreach() to generate measured ranges w/o
needing explicit support from the app/servlet
|
boolean |
isDirective(String directive)
This method finds out of the directive exists in the directives Map.
|
void |
Map()
for creating a map in a #set
#set($foo = {$foo : $bar, $blargh : $thingy})
|
void |
Method()
This method has yet to be fully implemented
but will allow arbitrarily nested method
calls
|
void |
MultiplicativeExpression() |
void |
ObjectArray() |
void |
Parameter()
This method has yet to be fully implemented
but will allow arbitrarily nested method
calls
|
void |
PrimaryExpression() |
ASTprocess |
process()
This method is what starts the whole parsing
process.
|
void |
Reference() |
void |
ReInit(CharStream stream)
Reinitialise.
|
void |
ReInit(VmParserTokenManager tm)
Reinitialise.
|
void |
RelationalExpression() |
void |
SetDirective()
Currently support both types of set :
#set( expr )
#set expr
|
void |
Statement()
These are the types of statements that
are acceptable in Velocity templates.
|
void |
StringLiteral() |
void |
Text()
This method is responsible for allowing
all non-grammar text to pass through
unscathed.
|
void |
Textblock() |
void |
True() |
void |
UnaryExpression() |
void |
Word() |
protected JJTVmParserState jjtree
public String currentTemplateName
public boolean strictEscape
public VmParserTokenManager token_source
public Token token
public Token jj_nt
public VmParser(CharStream stream)
public VmParser(VmParserTokenManager tm)
public Directive getDirective(String directive)
public boolean isDirective(String directive)
public final ASTprocess process() throws ParseException
ParseExceptionpublic final void Statement()
throws ParseException
ParseExceptionpublic final void EscapedDirective()
throws ParseException
ParseExceptionpublic final void Escape()
throws ParseException
ParseExceptionpublic final void Comment()
throws ParseException
ParseExceptionpublic final void Textblock()
throws ParseException
ParseExceptionpublic final void FloatingPointLiteral()
throws ParseException
ParseExceptionpublic final void IntegerLiteral()
throws ParseException
ParseExceptionpublic final void StringLiteral()
throws ParseException
ParseExceptionpublic final void Identifier()
throws ParseException
ParseExceptionpublic final void Word()
throws ParseException
ParseExceptionpublic final int DirectiveArg()
throws ParseException
ParseExceptionpublic final VmNode Directive() throws ParseException
ParseExceptionpublic final void Map()
throws ParseException
ParseExceptionpublic final void ObjectArray()
throws ParseException
ParseExceptionpublic final void IntegerRange()
throws ParseException
ParseExceptionpublic final void IndexParameter()
throws ParseException
ParseExceptionpublic final void Parameter()
throws ParseException
ParseExceptionpublic final void Method()
throws ParseException
ParseExceptionpublic final void Index()
throws ParseException
ParseExceptionpublic final void Reference()
throws ParseException
ParseExceptionpublic final void True()
throws ParseException
ParseExceptionpublic final void False()
throws ParseException
ParseExceptionpublic final void Text()
throws ParseException
ParseExceptionpublic final void ForeachStatement()
throws ParseException
ParseExceptionpublic final void IfStatement()
throws ParseException
ParseExceptionpublic final void ElseStatement()
throws ParseException
ParseExceptionpublic final void ElseIfStatement()
throws ParseException
ParseExceptionpublic final void SetDirective()
throws ParseException
ParseExceptionpublic final void Expression()
throws ParseException
ParseExceptionpublic final void Assignment()
throws ParseException
ParseExceptionpublic final void ConditionalOrExpression()
throws ParseException
ParseExceptionpublic final void ConditionalAndExpression()
throws ParseException
ParseExceptionpublic final void EqualityExpression()
throws ParseException
ParseExceptionpublic final void RelationalExpression()
throws ParseException
ParseExceptionpublic final void AdditiveExpression()
throws ParseException
ParseExceptionpublic final void MultiplicativeExpression()
throws ParseException
ParseExceptionpublic final void UnaryExpression()
throws ParseException
ParseExceptionpublic final void PrimaryExpression()
throws ParseException
ParseExceptionpublic void ReInit(CharStream stream)
public void ReInit(VmParserTokenManager tm)
public final Token getNextToken()
public final Token getToken(int index)
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()
Copyright © 2002-2014 InfoEther. All Rights Reserved.