Class StandardParser
- java.lang.Object
-
- org.apache.velocity.runtime.parser.StandardParser
-
- All Implemented Interfaces:
StandardParserTreeConstants
,Parser
,StandardParserConstants
public class StandardParser extends java.lang.Object implements StandardParserTreeConstants, Parser, StandardParserConstants
This class is responsible for parsing a Velocity xtemplate. This class was generated by JavaCC using the JJTree extension to produce an Abstract Syntax Tree (AST) of the xtemplate. Please look at the Parser.jjt file which is what controls the generation of this class.- Version:
- $Id$
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
StandardParser.JJCalls
private static class
StandardParser.LookaheadSuccess
-
Field Summary
Fields Modifier and Type Field Description private char
asterisk
private char
at
Template
currentTemplate
Current xtemplate we are parsing.private static boolean
debugParser
Parser debugging flag.private char
dollar
private char
hash
boolean
hyphenAllowedInIdentifiers
Set to true if the propoerty RuntimeConstants.PARSER_HYPHEN_ALLOWED is set to trueprivate StandardParser.JJCalls[]
jj_2_rtns
private int
jj_endpos
private java.util.List<int[]>
jj_expentries
private int[]
jj_expentry
private int
jj_gc
private int
jj_gen
private int
jj_kind
private int
jj_la
private int[]
jj_la1
private static int[]
jj_la1_0
private static int[]
jj_la1_1
private static int[]
jj_la1_2
private Token
jj_lastpos
private int[]
jj_lasttokens
private boolean
jj_lookingAhead
Whether we are looking ahead.private static StandardParser.LookaheadSuccess
jj_ls
Token
jj_nt
Next token.private int
jj_ntk
private boolean
jj_rescan
private Token
jj_scanpos
private boolean
jj_semLA
protected JJTStandardParserState
jjtree
private org.slf4j.Logger
log
private java.util.Map
macroNames
Keep track of defined macros, used for escape processingprivate RuntimeServices
rsvc
boolean
strictEscape
Set to true if the property RuntimeConstants.RUNTIME_REFERENCES_STRICT_ESCAPE is set to trueToken
token
Current token.StandardParserTokenManager
token_source
Generated Token Manager.private boolean
trace_enabled
(package private) VelocityCharStream
velcharstream
-
Fields inherited from interface org.apache.velocity.runtime.parser.StandardParserConstants
ALPHA_CHAR, ALT_VAL, BRACKETED_WORD, COLON, COMMA, DEFAULT, DIGIT, DIRECTIVE, DIRECTIVE_CHAR, DIRECTIVE_TERMINATOR, DIVIDE, DOLLAR, DOLLARBANG, DOT, DOUBLE_ESCAPE, DOUBLEDOT, ELSE, ELSEIF, 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_MULTILINE_COMMENT, IN_SINGLE_LINE_COMMENT, IN_TEXTBLOCK, INDEX_LBRACKET, INDEX_RBRACKET, INLINE_TEXT, 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, LOGICAL_OR_2, LONE_SYMBOL, LPAREN, MINUS, MODULUS, MULTI_LINE_COMMENT, MULTIPLY, NEWLINE, OLD_ALPHA_CHAR, OLD_IDENTIFIER, OLD_IDENTIFIER_CHAR, OLD_REFMODIFIER, PIPE, PLUS, PRE_DIRECTIVE, PRE_OLD_REFERENCE, PRE_REFERENCE, RBRACKET, RCURLY, REFERENCE, REFERENCE_TERMINATOR, REFINDEX, REFMOD, REFMOD2, REFMOD2_RPAREN, REFMOD3, REFMODIFIER, RIGHT_CURLEY, RPAREN, SET_DIRECTIVE, SINGLE_LINE_COMMENT, SINGLE_LINE_COMMENT_START, STRING_LITERAL, SUFFIX, TEXT, TEXTBLOCK, tokenImage, TRUE, WHITESPACE, WORD, ZERO_WIDTH_WHITESPACE
-
Fields inherited from interface org.apache.velocity.runtime.parser.node.StandardParserTreeConstants
JJTADDNODE, JJTANDNODE, JJTASSIGNMENT, JJTBLOCK, JJTCOMMENT, JJTDIRECTIVE, JJTDIRECTIVEASSIGN, JJTDIVNODE, JJTELSEIFSTATEMENT, JJTELSESTATEMENT, JJTEQNODE, JJTESCAPE, JJTESCAPEDDIRECTIVE, JJTEXPRESSION, JJTFALSE, JJTFLOATINGPOINTLITERAL, JJTGENODE, JJTGTNODE, JJTIDENTIFIER, JJTIFSTATEMENT, JJTINDEX, JJTINTEGERLITERAL, JJTINTEGERRANGE, JJTLENODE, JJTLTNODE, JJTMAP, JJTMETHOD, JJTMODNODE, JJTMULNODE, JJTNEGATENODE, JJTNENODE, jjtNodeName, JJTNOTNODE, JJTOBJECTARRAY, JJTORNODE, JJTPROCESS, JJTREFERENCE, JJTSETDIRECTIVE, JJTSTRINGLITERAL, JJTSUBTRACTNODE, JJTTEXT, JJTTEXTBLOCK, JJTTRUE, JJTVOID, JJTWORD
-
-
Constructor Summary
Constructors Constructor Description StandardParser(CharStream stream)
Constructor with user supplied CharStream.StandardParser(StandardParserTokenManager tm)
Constructor with generated Token Manager.StandardParser(RuntimeServices rs)
This constructor was added to allow the re-use of parsers.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
AdditiveExpression()
void
Assignment()
char
asterisk()
char
at()
boolean
Comment()
void
ConditionalAndExpression()
void
ConditionalOrExpression()
boolean
Directive(boolean afterNewline)
Supports the Pluggable Directives #foo( arg+ )int
DirectiveArg()
Supports the arguments for the Pluggable Directivesvoid
DirectiveAssign()
void
disable_tracing()
Disable tracing.char
dollar()
ASTBlock
ElseIfStatement(ASTBlock previousBlock, boolean afterNewline)
ASTBlock
ElseStatement(ASTBlock previousBlock, boolean afterNewline)
void
enable_tracing()
Enable tracing.void
EndingZeroWidthWhitespace()
void
EqualityExpression()
void
Escape()
Used to catch and process escape sequences in grammatical constructs as escapes outside of VTL are just characters.private java.lang.String
escapedDirective(java.lang.String strImage)
Produces a processed output for an escaped control or pluggable directivevoid
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()
ParseException
generateParseException()
Generate ParseException.Template
getCurrentTemplate()
Directive
getDirective(java.lang.String directive)
This method gets a Directive from the directives HashtableToken
getNextToken()
Get the next Token.RuntimeServices
getRuntimeServices()
Token
getToken(int index)
Get the specific Token.char
hash()
void
Identifier()
This method corresponds to variable references in Velocity xtemplates.boolean
IfStatement(boolean afterNewline)
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/servletprivate boolean
isAssignment()
We use this method in a lookahead to determine if we are in a macro default value assignment.boolean
isDirective(java.lang.String directive)
This method finds out of the directive exists in the directives Map.private boolean
isLeftParenthesis()
Check whether there is a left parenthesis with leading optional whitespaces.private boolean
isRightParenthesis()
Check whether there is a right parenthesis with leading optional whitespaces.private boolean
jj_2_1(int xla)
private boolean
jj_2_10(int xla)
private boolean
jj_2_11(int xla)
private boolean
jj_2_12(int xla)
private boolean
jj_2_13(int xla)
private boolean
jj_2_14(int xla)
private boolean
jj_2_15(int xla)
private boolean
jj_2_16(int xla)
private boolean
jj_2_17(int xla)
private boolean
jj_2_18(int xla)
private boolean
jj_2_19(int xla)
private boolean
jj_2_2(int xla)
private boolean
jj_2_20(int xla)
private boolean
jj_2_21(int xla)
private boolean
jj_2_22(int xla)
private boolean
jj_2_23(int xla)
private boolean
jj_2_24(int xla)
private boolean
jj_2_3(int xla)
private boolean
jj_2_4(int xla)
private boolean
jj_2_5(int xla)
private boolean
jj_2_6(int xla)
private boolean
jj_2_7(int xla)
private boolean
jj_2_8(int xla)
private boolean
jj_2_9(int xla)
private boolean
jj_3_1()
private boolean
jj_3_10()
private boolean
jj_3_11()
private boolean
jj_3_12()
private boolean
jj_3_13()
private boolean
jj_3_14()
private boolean
jj_3_15()
private boolean
jj_3_16()
private boolean
jj_3_17()
private boolean
jj_3_18()
private boolean
jj_3_19()
private boolean
jj_3_2()
private boolean
jj_3_20()
private boolean
jj_3_21()
private boolean
jj_3_22()
private boolean
jj_3_23()
private boolean
jj_3_24()
private boolean
jj_3_3()
private boolean
jj_3_4()
private boolean
jj_3_5()
private boolean
jj_3_6()
private boolean
jj_3_7()
private boolean
jj_3_8()
private boolean
jj_3_9()
private boolean
jj_3R_AdditiveExpression_2474_5_139()
private boolean
jj_3R_AdditiveExpression_2476_9_146()
private boolean
jj_3R_AdditiveExpression_2476_9_156()
private boolean
jj_3R_AdditiveExpression_2477_9_157()
private boolean
jj_3R_Comment_1666_2_48()
private boolean
jj_3R_Comment_1666_2_72()
private boolean
jj_3R_Comment_1667_5_73()
private boolean
jj_3R_Comment_1668_5_74()
private boolean
jj_3R_ConditionalAndExpression_2448_3_130()
private boolean
jj_3R_ConditionalAndExpression_2449_5_138()
private boolean
jj_3R_ConditionalOrExpression_2441_3_124()
private boolean
jj_3R_ConditionalOrExpression_2442_6_135()
private boolean
jj_3R_Directive_1880_15_54()
private boolean
jj_3R_Directive_1886_13_55()
private boolean
jj_3R_DirectiveArg_1717_5_56()
private boolean
jj_3R_DirectiveArg_1717_5_77()
private boolean
jj_3R_DirectiveArg_1721_5_78()
private boolean
jj_3R_DirectiveArg_1725_5_79()
private boolean
jj_3R_DirectiveArg_1730_5_80()
private boolean
jj_3R_DirectiveArg_1737_5_81()
private boolean
jj_3R_DirectiveArg_1741_5_82()
private boolean
jj_3R_DirectiveArg_1745_5_83()
private boolean
jj_3R_DirectiveArg_1749_5_84()
private boolean
jj_3R_DirectiveArg_1753_5_85()
private boolean
jj_3R_DirectiveArg_1757_5_86()
private boolean
jj_3R_DirectiveAssign_1765_5_76()
private boolean
jj_3R_EndingZeroWidthWhitespace_1586_5_49()
private boolean
jj_3R_EqualityExpression_2454_5_132()
private boolean
jj_3R_EqualityExpression_2456_8_140()
private boolean
jj_3R_EqualityExpression_2456_8_143()
private boolean
jj_3R_EqualityExpression_2457_8_144()
private boolean
jj_3R_Expression_2429_1_109()
private boolean
jj_3R_False_2186_5_108()
private boolean
jj_3R_FloatingPointLiteral_1678_5_104()
private boolean
jj_3R_Identifier_1704_5_98()
private boolean
jj_3R_Index_2156_4_110()
private boolean
jj_3R_IndexParameter_2113_5_131()
private boolean
jj_3R_IndexParameter_2113_6_133()
private boolean
jj_3R_IndexParameter_2117_6_134()
private boolean
jj_3R_IntegerLiteral_1683_6_75()
private boolean
jj_3R_IntegerRange_2100_17_113()
private boolean
jj_3R_IntegerRange_2100_5_103()
private boolean
jj_3R_IntegerRange_2101_21_115()
private boolean
jj_3R_IntegerRange_2101_7_114()
private boolean
jj_3R_IntegerRange_2102_44_117()
private boolean
jj_3R_IntegerRange_2102_6_116()
private boolean
jj_3R_IntegerRange_2103_20_119()
private boolean
jj_3R_IntegerRange_2103_6_118()
private boolean
jj_3R_IntegerRange_2104_6_120()
private boolean
jj_3R_Map_2076_5_105()
private boolean
jj_3R_Map_2078_103_127()
private boolean
jj_3R_Map_2078_7_121()
private boolean
jj_3R_Map_2080_7_122()
private boolean
jj_3R_Map_2080_9_128()
private boolean
jj_3R_Method_2150_28_99()
private boolean
jj_3R_Method_2150_4_64()
private boolean
jj_3R_Method_2150_43_137()
private boolean
jj_3R_MultiplicativeExpression_2483_5_141()
private boolean
jj_3R_MultiplicativeExpression_2485_13_155()
private boolean
jj_3R_MultiplicativeExpression_2485_13_159()
private boolean
jj_3R_MultiplicativeExpression_2486_13_160()
private boolean
jj_3R_MultiplicativeExpression_2487_13_161()
private boolean
jj_3R_null_1737_29_50()
private boolean
jj_3R_null_1737_58_51()
private boolean
jj_3R_null_1737_72_52()
private boolean
jj_3R_null_1737_95_53()
private boolean
jj_3R_null_2078_19_57()
private boolean
jj_3R_null_2132_107_62()
private boolean
jj_3R_null_2132_36_59()
private boolean
jj_3R_null_2132_69_60()
private boolean
jj_3R_null_2132_83_61()
private boolean
jj_3R_null_2508_103_69()
private boolean
jj_3R_null_2508_32_66()
private boolean
jj_3R_null_2508_65_67()
private boolean
jj_3R_null_2508_79_68()
private boolean
jj_3R_ObjectArray_2089_18_123()
private boolean
jj_3R_ObjectArray_2089_32_129()
private boolean
jj_3R_ObjectArray_2089_5_106()
private boolean
jj_3R_Parameter_2128_5_58()
private boolean
jj_3R_Parameter_2128_6_87()
private boolean
jj_3R_Parameter_2130_9_88()
private boolean
jj_3R_Parameter_2131_11_89()
private boolean
jj_3R_Parameter_2132_11_90()
private boolean
jj_3R_Parameter_2133_11_91()
private boolean
jj_3R_Parameter_2134_11_92()
private boolean
jj_3R_Parameter_2135_11_93()
private boolean
jj_3R_Parameter_2136_11_94()
private boolean
jj_3R_Parameter_2137_11_95()
private boolean
jj_3R_Parameter_2138_11_96()
private boolean
jj_3R_Parameter_2140_6_97()
private boolean
jj_3R_PrimaryExpression_2503_5_158()
private boolean
jj_3R_PrimaryExpression_2503_7_162()
private boolean
jj_3R_PrimaryExpression_2505_6_163()
private boolean
jj_3R_PrimaryExpression_2506_7_164()
private boolean
jj_3R_PrimaryExpression_2507_7_165()
private boolean
jj_3R_PrimaryExpression_2508_7_166()
private boolean
jj_3R_PrimaryExpression_2509_7_167()
private boolean
jj_3R_PrimaryExpression_2510_7_168()
private boolean
jj_3R_PrimaryExpression_2511_7_169()
private boolean
jj_3R_PrimaryExpression_2512_7_170()
private boolean
jj_3R_PrimaryExpression_2513_7_171()
private boolean
jj_3R_PrimaryExpression_2514_7_172()
private boolean
jj_3R_PrimaryExpression_2516_7_173()
private boolean
jj_3R_Reference_2161_7_47()
private boolean
jj_3R_Reference_2165_7_70()
private boolean
jj_3R_Reference_2166_45_100()
private boolean
jj_3R_Reference_2167_55_63()
private boolean
jj_3R_Reference_2167_71_125()
private boolean
jj_3R_Reference_2170_7_71()
private boolean
jj_3R_Reference_2172_47_111()
private boolean
jj_3R_Reference_2173_55_65()
private boolean
jj_3R_Reference_2173_71_126()
private boolean
jj_3R_Reference_2174_12_112()
private boolean
jj_3R_RelationalExpression_2463_5_136()
private boolean
jj_3R_RelationalExpression_2465_9_142()
private boolean
jj_3R_RelationalExpression_2465_9_147()
private boolean
jj_3R_RelationalExpression_2466_9_148()
private boolean
jj_3R_RelationalExpression_2467_9_149()
private boolean
jj_3R_RelationalExpression_2468_9_150()
private boolean
jj_3R_StringLiteral_1688_5_102()
private boolean
jj_3R_True_2181_5_107()
private boolean
jj_3R_UnaryExpression_2493_5_145()
private boolean
jj_3R_UnaryExpression_2493_7_151()
private boolean
jj_3R_UnaryExpression_2495_11_152()
private boolean
jj_3R_UnaryExpression_2496_10_153()
private boolean
jj_3R_UnaryExpression_2497_11_154()
private boolean
jj_3R_Word_1709_5_101()
private void
jj_add_error_token(int kind, int pos)
private Token
jj_consume_token(int kind)
private static void
jj_la1_init_0()
private static void
jj_la1_init_1()
private static void
jj_la1_init_2()
private int
jj_ntk_f()
private void
jj_rescan_token()
private void
jj_save(int index, int xla)
private boolean
jj_scan_token(int kind)
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 callsvoid
MultiplicativeExpression()
void
ObjectArray()
void
Parameter()
This method has yet to be fully implemented but will allow arbitrarily nested method callsSimpleNode
parse(java.io.Reader reader, Template xtemplate)
This was also added to allow parsers to be re-usable.void
PrimaryExpression()
SimpleNode
process()
This method is what starts the whole parsing process.void
Reference()
void
ReInit(CharStream stream)
Reinitialise.void
ReInit(StandardParserTokenManager tm)
Reinitialise.void
RelationalExpression()
void
resetCurrentTemplate()
boolean
SetDirective(boolean afterNewline)
Currently support both types of set : #set( expr ) #set exprboolean
Statement(boolean afterNewline)
These are the types of statements that are acceptable in Velocity xtemplates.void
StringLiteral()
boolean
Text()
This method is responsible for allowing all non-grammar text to pass through unscathed.void
Textblock()
static void
trace(java.lang.String message)
Our own trace method.boolean
trace_enabled()
Trace enabled.void
True()
void
UnaryExpression()
void
Word()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.velocity.runtime.parser.Parser
blockComment, lineComment
-
-
-
-
Field Detail
-
jjtree
protected JJTStandardParserState jjtree
-
debugParser
private static boolean debugParser
Parser debugging flag. When debug is active, javacc Parser will contain (among other things) a trace_call() method. So we use the presence of this method to initialize our flag.
-
macroNames
private java.util.Map macroNames
Keep track of defined macros, used for escape processing
-
currentTemplate
public Template currentTemplate
Current xtemplate we are parsing. Passed to us in parse()
-
strictEscape
public boolean strictEscape
Set to true if the property RuntimeConstants.RUNTIME_REFERENCES_STRICT_ESCAPE is set to true
-
hyphenAllowedInIdentifiers
public boolean hyphenAllowedInIdentifiers
Set to true if the propoerty RuntimeConstants.PARSER_HYPHEN_ALLOWED is set to true
-
velcharstream
VelocityCharStream velcharstream
-
rsvc
private RuntimeServices rsvc
-
log
private org.slf4j.Logger log
-
dollar
private char dollar
-
hash
private char hash
-
at
private char at
-
asterisk
private char asterisk
-
token_source
public StandardParserTokenManager token_source
Generated Token Manager.
-
token
public Token token
Current token.
-
jj_nt
public Token jj_nt
Next token.
-
jj_ntk
private int jj_ntk
-
jj_scanpos
private Token jj_scanpos
-
jj_lastpos
private Token jj_lastpos
-
jj_la
private int jj_la
-
jj_lookingAhead
private boolean jj_lookingAhead
Whether we are looking ahead.
-
jj_semLA
private boolean jj_semLA
-
jj_gen
private int jj_gen
-
jj_la1
private final int[] jj_la1
-
jj_la1_0
private static int[] jj_la1_0
-
jj_la1_1
private static int[] jj_la1_1
-
jj_la1_2
private static int[] jj_la1_2
-
jj_2_rtns
private final StandardParser.JJCalls[] jj_2_rtns
-
jj_rescan
private boolean jj_rescan
-
jj_gc
private int jj_gc
-
jj_ls
private static final StandardParser.LookaheadSuccess jj_ls
-
jj_expentries
private java.util.List<int[]> jj_expentries
-
jj_expentry
private int[] jj_expentry
-
jj_kind
private int jj_kind
-
jj_lasttokens
private int[] jj_lasttokens
-
jj_endpos
private int jj_endpos
-
trace_enabled
private boolean trace_enabled
-
-
Constructor Detail
-
StandardParser
public StandardParser(RuntimeServices rs)
This constructor was added to allow the re-use of parsers. The normal constructor takes a single argument which an InputStream. This simply creates a re-usable parser object, we satisfy the requirement of an InputStream by using a newline character as an input stream.
-
StandardParser
public StandardParser(CharStream stream)
Constructor with user supplied CharStream.
-
StandardParser
public StandardParser(StandardParserTokenManager tm)
Constructor with generated Token Manager.
-
-
Method Detail
-
trace
public static void trace(java.lang.String message)
Our own trace method. Use sparsingly in production, since each and every call will introduce an execution branch and slow down parsing.
-
getRuntimeServices
public RuntimeServices getRuntimeServices()
- Specified by:
getRuntimeServices
in interfaceParser
-
parse
public SimpleNode parse(java.io.Reader reader, Template xtemplate) throws ParseException
This was also added to allow parsers to be re-usable. Normal JavaCC use entails passing an input stream to the constructor and the parsing process is carried out once. We want to be able to re-use parsers: we do this by adding this method and re-initializing the lexer with the new stream that we want parsed.- Specified by:
parse
in interfaceParser
- Throws:
ParseException
-
getDirective
public Directive getDirective(java.lang.String directive)
This method gets a Directive from the directives Hashtable- Specified by:
getDirective
in interfaceParser
-
isDirective
public boolean isDirective(java.lang.String directive)
This method finds out of the directive exists in the directives Map.- Specified by:
isDirective
in interfaceParser
-
escapedDirective
private java.lang.String escapedDirective(java.lang.String strImage)
Produces a processed output for an escaped control or pluggable directive
-
isLeftParenthesis
private boolean isLeftParenthesis()
Check whether there is a left parenthesis with leading optional whitespaces. This method is used in the semantic look ahead of Directive method. This is done in code instead of as a production for simplicity and efficiency.
-
isRightParenthesis
private boolean isRightParenthesis()
Check whether there is a right parenthesis with leading optional whitespaces. This method is used in the semantic look ahead of Directive method. This is done in code instead of as a production for simplicity and efficiency.
-
isAssignment
private boolean isAssignment()
We use this method in a lookahead to determine if we are in a macro default value assignment. The standard lookahead is not smart enough. here we look for the equals after the reference.
-
getCurrentTemplate
public Template getCurrentTemplate()
- Specified by:
getCurrentTemplate
in interfaceParser
-
resetCurrentTemplate
public void resetCurrentTemplate()
- Specified by:
resetCurrentTemplate
in interfaceParser
-
process
public final SimpleNode process() throws ParseException
This method is what starts the whole parsing process. After the parsing is complete and the xtemplate has been turned into an AST, this method returns the root of AST which can subsequently be traversed by a visitor which implements the ParserVisitor interface which is generated automatically by JavaCC- Throws:
ParseException
-
Statement
public final boolean Statement(boolean afterNewline) throws ParseException
These are the types of statements that are acceptable in Velocity xtemplates.- Throws:
ParseException
-
EndingZeroWidthWhitespace
public final void EndingZeroWidthWhitespace() throws ParseException
- Throws:
ParseException
-
EscapedDirective
public final void EscapedDirective() throws ParseException
used to separate the notion of a valid directive that has been escaped, versus something that looks like a directive and is just schmoo. This is important to do as a separate production that creates a node, because we want this, in either case, to stop the further parsing of the Directive() tree.- Throws:
ParseException
-
Escape
public final void Escape() throws ParseException
Used to catch and process escape sequences in grammatical constructs as escapes outside of VTL are just characters. Right now we have both this and the EscapeDirective() construction because in the EscapeDirective() case, we want to suck in the #<directive> and here we don't. We just want the escapes to render correctly- Throws:
ParseException
-
Comment
public final boolean Comment() throws ParseException
- Throws:
ParseException
-
Textblock
public final void Textblock() throws ParseException
- Throws:
ParseException
-
FloatingPointLiteral
public final void FloatingPointLiteral() throws ParseException
- Throws:
ParseException
-
IntegerLiteral
public final void IntegerLiteral() throws ParseException
- Throws:
ParseException
-
StringLiteral
public final void StringLiteral() throws ParseException
- Throws:
ParseException
-
Identifier
public final void Identifier() throws ParseException
This method corresponds to variable references in Velocity xtemplates. The following are examples of variable references that may be found in a xtemplate: $foo $bar- Throws:
ParseException
-
Word
public final void Word() throws ParseException
- Throws:
ParseException
-
DirectiveArg
public final int DirectiveArg() throws ParseException
Supports the arguments for the Pluggable Directives- Throws:
ParseException
-
DirectiveAssign
public final void DirectiveAssign() throws ParseException
- Throws:
ParseException
-
Directive
public final boolean Directive(boolean afterNewline) throws ParseException
Supports the Pluggable Directives #foo( arg+ )- Returns:
- true if ends with a newline
- Throws:
ParseException
-
Map
public final void Map() throws ParseException
for creating a map in a #set #set($foo = {$foo : $bar, $blargh : $thingy})- Throws:
ParseException
-
ObjectArray
public final void ObjectArray() throws ParseException
- Throws:
ParseException
-
IntegerRange
public final void IntegerRange() throws ParseException
supports the [n..m] vector generator for use in the #foreach() to generate measured ranges w/o needing explicit support from the app/servlet- Throws:
ParseException
-
IndexParameter
public final void IndexParameter() throws ParseException
A Simplified parameter more suitable for an index position: $foo[$index]- Throws:
ParseException
-
Parameter
public final void Parameter() throws ParseException
This method has yet to be fully implemented but will allow arbitrarily nested method calls- Throws:
ParseException
-
Method
public final void Method() throws ParseException
This method has yet to be fully implemented but will allow arbitrarily nested method calls- Throws:
ParseException
-
Index
public final void Index() throws ParseException
- Throws:
ParseException
-
Reference
public final void Reference() throws ParseException
- Throws:
ParseException
-
True
public final void True() throws ParseException
- Throws:
ParseException
-
False
public final void False() throws ParseException
- Throws:
ParseException
-
Text
public final boolean Text() throws ParseException
This method is responsible for allowing all non-grammar text to pass through unscathed.- Returns:
- true if last read token was a newline
- Throws:
ParseException
-
IfStatement
public final boolean IfStatement(boolean afterNewline) throws ParseException
- Throws:
ParseException
-
ElseStatement
public final ASTBlock ElseStatement(ASTBlock previousBlock, boolean afterNewline) throws ParseException
- Throws:
ParseException
-
ElseIfStatement
public final ASTBlock ElseIfStatement(ASTBlock previousBlock, boolean afterNewline) throws ParseException
- Throws:
ParseException
-
SetDirective
public final boolean SetDirective(boolean afterNewline) throws ParseException
Currently support both types of set : #set( expr ) #set expr- Throws:
ParseException
-
Expression
public final void Expression() throws ParseException
- Throws:
ParseException
-
Assignment
public final void Assignment() throws ParseException
- Throws:
ParseException
-
ConditionalOrExpression
public final void ConditionalOrExpression() throws ParseException
- Throws:
ParseException
-
ConditionalAndExpression
public final void ConditionalAndExpression() throws ParseException
- Throws:
ParseException
-
EqualityExpression
public final void EqualityExpression() throws ParseException
- Throws:
ParseException
-
RelationalExpression
public final void RelationalExpression() throws ParseException
- Throws:
ParseException
-
AdditiveExpression
public final void AdditiveExpression() throws ParseException
- Throws:
ParseException
-
MultiplicativeExpression
public final void MultiplicativeExpression() throws ParseException
- Throws:
ParseException
-
UnaryExpression
public final void UnaryExpression() throws ParseException
- Throws:
ParseException
-
PrimaryExpression
public final void PrimaryExpression() throws ParseException
- Throws:
ParseException
-
jj_2_1
private boolean jj_2_1(int xla)
-
jj_2_2
private boolean jj_2_2(int xla)
-
jj_2_3
private boolean jj_2_3(int xla)
-
jj_2_4
private boolean jj_2_4(int xla)
-
jj_2_5
private boolean jj_2_5(int xla)
-
jj_2_6
private boolean jj_2_6(int xla)
-
jj_2_7
private boolean jj_2_7(int xla)
-
jj_2_8
private boolean jj_2_8(int xla)
-
jj_2_9
private boolean jj_2_9(int xla)
-
jj_2_10
private boolean jj_2_10(int xla)
-
jj_2_11
private boolean jj_2_11(int xla)
-
jj_2_12
private boolean jj_2_12(int xla)
-
jj_2_13
private boolean jj_2_13(int xla)
-
jj_2_14
private boolean jj_2_14(int xla)
-
jj_2_15
private boolean jj_2_15(int xla)
-
jj_2_16
private boolean jj_2_16(int xla)
-
jj_2_17
private boolean jj_2_17(int xla)
-
jj_2_18
private boolean jj_2_18(int xla)
-
jj_2_19
private boolean jj_2_19(int xla)
-
jj_2_20
private boolean jj_2_20(int xla)
-
jj_2_21
private boolean jj_2_21(int xla)
-
jj_2_22
private boolean jj_2_22(int xla)
-
jj_2_23
private boolean jj_2_23(int xla)
-
jj_2_24
private boolean jj_2_24(int xla)
-
jj_3_20
private boolean jj_3_20()
-
jj_3_19
private boolean jj_3_19()
-
jj_3R_Directive_1886_13_55
private boolean jj_3R_Directive_1886_13_55()
-
jj_3R_Directive_1880_15_54
private boolean jj_3R_Directive_1880_15_54()
-
jj_3_6
private boolean jj_3_6()
-
jj_3_18
private boolean jj_3_18()
-
jj_3R_Reference_2173_71_126
private boolean jj_3R_Reference_2173_71_126()
-
jj_3R_null_2132_107_62
private boolean jj_3R_null_2132_107_62()
-
jj_3R_Reference_2167_71_125
private boolean jj_3R_Reference_2167_71_125()
-
jj_3R_Reference_2173_55_65
private boolean jj_3R_Reference_2173_55_65()
-
jj_3R_null_2508_103_69
private boolean jj_3R_null_2508_103_69()
-
jj_3R_Reference_2167_55_63
private boolean jj_3R_Reference_2167_55_63()
-
jj_3R_Reference_2172_47_111
private boolean jj_3R_Reference_2172_47_111()
-
jj_3R_null_1737_95_53
private boolean jj_3R_null_1737_95_53()
-
jj_3R_null_2132_83_61
private boolean jj_3R_null_2132_83_61()
-
jj_3R_Reference_2166_45_100
private boolean jj_3R_Reference_2166_45_100()
-
jj_3_17
private boolean jj_3_17()
-
jj_3R_null_2508_79_68
private boolean jj_3R_null_2508_79_68()
-
jj_3R_null_2132_69_60
private boolean jj_3R_null_2132_69_60()
-
jj_3_15
private boolean jj_3_15()
-
jj_3R_Method_2150_43_137
private boolean jj_3R_Method_2150_43_137()
-
jj_3R_null_1737_72_52
private boolean jj_3R_null_1737_72_52()
-
jj_3R_False_2186_5_108
private boolean jj_3R_False_2186_5_108()
-
jj_3R_null_2508_65_67
private boolean jj_3R_null_2508_65_67()
-
jj_3R_True_2181_5_107
private boolean jj_3R_True_2181_5_107()
-
jj_3R_Reference_2174_12_112
private boolean jj_3R_Reference_2174_12_112()
-
jj_3_16
private boolean jj_3_16()
-
jj_3R_Map_2078_103_127
private boolean jj_3R_Map_2078_103_127()
-
jj_3R_null_1737_58_51
private boolean jj_3R_null_1737_58_51()
-
jj_3_14
private boolean jj_3_14()
-
jj_3R_Method_2150_28_99
private boolean jj_3R_Method_2150_28_99()
-
jj_3R_Reference_2170_7_71
private boolean jj_3R_Reference_2170_7_71()
-
jj_3R_Reference_2165_7_70
private boolean jj_3R_Reference_2165_7_70()
-
jj_3R_null_2132_36_59
private boolean jj_3R_null_2132_36_59()
-
jj_3R_Reference_2161_7_47
private boolean jj_3R_Reference_2161_7_47()
-
jj_3R_Index_2156_4_110
private boolean jj_3R_Index_2156_4_110()
-
jj_3R_null_2508_32_66
private boolean jj_3R_null_2508_32_66()
-
jj_3_13
private boolean jj_3_13()
-
jj_3R_Method_2150_4_64
private boolean jj_3R_Method_2150_4_64()
-
jj_3R_DirectiveAssign_1765_5_76
private boolean jj_3R_DirectiveAssign_1765_5_76()
-
jj_3R_null_1737_29_50
private boolean jj_3R_null_1737_29_50()
-
jj_3R_Parameter_2138_11_96
private boolean jj_3R_Parameter_2138_11_96()
-
jj_3R_Parameter_2137_11_95
private boolean jj_3R_Parameter_2137_11_95()
-
jj_3R_Parameter_2136_11_94
private boolean jj_3R_Parameter_2136_11_94()
-
jj_3R_Parameter_2135_11_93
private boolean jj_3R_Parameter_2135_11_93()
-
jj_3R_Parameter_2140_6_97
private boolean jj_3R_Parameter_2140_6_97()
-
jj_3R_IntegerRange_2102_44_117
private boolean jj_3R_IntegerRange_2102_44_117()
-
jj_3R_DirectiveArg_1757_5_86
private boolean jj_3R_DirectiveArg_1757_5_86()
-
jj_3R_Parameter_2134_11_92
private boolean jj_3R_Parameter_2134_11_92()
-
jj_3R_Parameter_2133_11_91
private boolean jj_3R_Parameter_2133_11_91()
-
jj_3_24
private boolean jj_3_24()
-
jj_3R_Parameter_2132_11_90
private boolean jj_3R_Parameter_2132_11_90()
-
jj_3R_Parameter_2131_11_89
private boolean jj_3R_Parameter_2131_11_89()
-
jj_3R_DirectiveArg_1753_5_85
private boolean jj_3R_DirectiveArg_1753_5_85()
-
jj_3R_PrimaryExpression_2516_7_173
private boolean jj_3R_PrimaryExpression_2516_7_173()
-
jj_3R_Parameter_2130_9_88
private boolean jj_3R_Parameter_2130_9_88()
-
jj_3R_PrimaryExpression_2514_7_172
private boolean jj_3R_PrimaryExpression_2514_7_172()
-
jj_3R_PrimaryExpression_2513_7_171
private boolean jj_3R_PrimaryExpression_2513_7_171()
-
jj_3R_DirectiveArg_1749_5_84
private boolean jj_3R_DirectiveArg_1749_5_84()
-
jj_3_5
private boolean jj_3_5()
-
jj_3R_PrimaryExpression_2512_7_170
private boolean jj_3R_PrimaryExpression_2512_7_170()
-
jj_3R_PrimaryExpression_2511_7_169
private boolean jj_3R_PrimaryExpression_2511_7_169()
-
jj_3R_PrimaryExpression_2510_7_168
private boolean jj_3R_PrimaryExpression_2510_7_168()
-
jj_3R_Parameter_2128_6_87
private boolean jj_3R_Parameter_2128_6_87()
-
jj_3R_PrimaryExpression_2509_7_167
private boolean jj_3R_PrimaryExpression_2509_7_167()
-
jj_3R_DirectiveArg_1745_5_83
private boolean jj_3R_DirectiveArg_1745_5_83()
-
jj_3R_Parameter_2128_5_58
private boolean jj_3R_Parameter_2128_5_58()
-
jj_3R_PrimaryExpression_2508_7_166
private boolean jj_3R_PrimaryExpression_2508_7_166()
-
jj_3R_PrimaryExpression_2507_7_165
private boolean jj_3R_PrimaryExpression_2507_7_165()
-
jj_3R_PrimaryExpression_2506_7_164
private boolean jj_3R_PrimaryExpression_2506_7_164()
-
jj_3R_DirectiveArg_1741_5_82
private boolean jj_3R_DirectiveArg_1741_5_82()
-
jj_3R_PrimaryExpression_2505_6_163
private boolean jj_3R_PrimaryExpression_2505_6_163()
-
jj_3R_PrimaryExpression_2503_7_162
private boolean jj_3R_PrimaryExpression_2503_7_162()
-
jj_3R_PrimaryExpression_2503_5_158
private boolean jj_3R_PrimaryExpression_2503_5_158()
-
jj_3R_UnaryExpression_2497_11_154
private boolean jj_3R_UnaryExpression_2497_11_154()
-
jj_3R_DirectiveArg_1737_5_81
private boolean jj_3R_DirectiveArg_1737_5_81()
-
jj_3R_UnaryExpression_2496_10_153
private boolean jj_3R_UnaryExpression_2496_10_153()
-
jj_3R_UnaryExpression_2495_11_152
private boolean jj_3R_UnaryExpression_2495_11_152()
-
jj_3R_IntegerRange_2103_20_119
private boolean jj_3R_IntegerRange_2103_20_119()
-
jj_3R_IndexParameter_2117_6_134
private boolean jj_3R_IndexParameter_2117_6_134()
-
jj_3R_IntegerRange_2101_21_115
private boolean jj_3R_IntegerRange_2101_21_115()
-
jj_3R_ObjectArray_2089_32_129
private boolean jj_3R_ObjectArray_2089_32_129()
-
jj_3R_IndexParameter_2113_6_133
private boolean jj_3R_IndexParameter_2113_6_133()
-
jj_3R_DirectiveArg_1730_5_80
private boolean jj_3R_DirectiveArg_1730_5_80()
-
jj_3R_IndexParameter_2113_5_131
private boolean jj_3R_IndexParameter_2113_5_131()
-
jj_3R_MultiplicativeExpression_2487_13_161
private boolean jj_3R_MultiplicativeExpression_2487_13_161()
-
jj_3R_IntegerRange_2100_17_113
private boolean jj_3R_IntegerRange_2100_17_113()
-
jj_3R_UnaryExpression_2493_7_151
private boolean jj_3R_UnaryExpression_2493_7_151()
-
jj_3R_MultiplicativeExpression_2486_13_160
private boolean jj_3R_MultiplicativeExpression_2486_13_160()
-
jj_3R_MultiplicativeExpression_2485_13_159
private boolean jj_3R_MultiplicativeExpression_2485_13_159()
-
jj_3R_MultiplicativeExpression_2485_13_155
private boolean jj_3R_MultiplicativeExpression_2485_13_155()
-
jj_3R_UnaryExpression_2493_5_145
private boolean jj_3R_UnaryExpression_2493_5_145()
-
jj_3R_DirectiveArg_1725_5_79
private boolean jj_3R_DirectiveArg_1725_5_79()
-
jj_3R_IntegerRange_2104_6_120
private boolean jj_3R_IntegerRange_2104_6_120()
-
jj_3R_DirectiveArg_1721_5_78
private boolean jj_3R_DirectiveArg_1721_5_78()
-
jj_3R_IntegerRange_2103_6_118
private boolean jj_3R_IntegerRange_2103_6_118()
-
jj_3R_IntegerRange_2101_7_114
private boolean jj_3R_IntegerRange_2101_7_114()
-
jj_3R_IntegerRange_2102_6_116
private boolean jj_3R_IntegerRange_2102_6_116()
-
jj_3R_ObjectArray_2089_18_123
private boolean jj_3R_ObjectArray_2089_18_123()
-
jj_3R_DirectiveArg_1717_5_77
private boolean jj_3R_DirectiveArg_1717_5_77()
-
jj_3R_DirectiveArg_1717_5_56
private boolean jj_3R_DirectiveArg_1717_5_56()
-
jj_3R_IntegerRange_2100_5_103
private boolean jj_3R_IntegerRange_2100_5_103()
-
jj_3R_MultiplicativeExpression_2483_5_141
private boolean jj_3R_MultiplicativeExpression_2483_5_141()
-
jj_3R_AdditiveExpression_2477_9_157
private boolean jj_3R_AdditiveExpression_2477_9_157()
-
jj_3R_AdditiveExpression_2476_9_156
private boolean jj_3R_AdditiveExpression_2476_9_156()
-
jj_3R_AdditiveExpression_2476_9_146
private boolean jj_3R_AdditiveExpression_2476_9_146()
-
jj_3R_Word_1709_5_101
private boolean jj_3R_Word_1709_5_101()
-
jj_3R_null_2078_19_57
private boolean jj_3R_null_2078_19_57()
-
jj_3R_AdditiveExpression_2474_5_139
private boolean jj_3R_AdditiveExpression_2474_5_139()
-
jj_3_12
private boolean jj_3_12()
-
jj_3R_ObjectArray_2089_5_106
private boolean jj_3R_ObjectArray_2089_5_106()
-
jj_3R_RelationalExpression_2468_9_150
private boolean jj_3R_RelationalExpression_2468_9_150()
-
jj_3R_RelationalExpression_2467_9_149
private boolean jj_3R_RelationalExpression_2467_9_149()
-
jj_3R_Identifier_1704_5_98
private boolean jj_3R_Identifier_1704_5_98()
-
jj_3R_RelationalExpression_2466_9_148
private boolean jj_3R_RelationalExpression_2466_9_148()
-
jj_3R_RelationalExpression_2465_9_142
private boolean jj_3R_RelationalExpression_2465_9_142()
-
jj_3R_RelationalExpression_2465_9_147
private boolean jj_3R_RelationalExpression_2465_9_147()
-
jj_3R_Map_2080_9_128
private boolean jj_3R_Map_2080_9_128()
-
jj_3R_Map_2080_7_122
private boolean jj_3R_Map_2080_7_122()
-
jj_3R_Map_2078_7_121
private boolean jj_3R_Map_2078_7_121()
-
jj_3R_RelationalExpression_2463_5_136
private boolean jj_3R_RelationalExpression_2463_5_136()
-
jj_3R_EqualityExpression_2457_8_144
private boolean jj_3R_EqualityExpression_2457_8_144()
-
jj_3R_Map_2076_5_105
private boolean jj_3R_Map_2076_5_105()
-
jj_3R_EqualityExpression_2456_8_140
private boolean jj_3R_EqualityExpression_2456_8_140()
-
jj_3R_EqualityExpression_2456_8_143
private boolean jj_3R_EqualityExpression_2456_8_143()
-
jj_3R_StringLiteral_1688_5_102
private boolean jj_3R_StringLiteral_1688_5_102()
-
jj_3R_EqualityExpression_2454_5_132
private boolean jj_3R_EqualityExpression_2454_5_132()
-
jj_3R_IntegerLiteral_1683_6_75
private boolean jj_3R_IntegerLiteral_1683_6_75()
-
jj_3R_ConditionalAndExpression_2449_5_138
private boolean jj_3R_ConditionalAndExpression_2449_5_138()
-
jj_3R_ConditionalAndExpression_2448_3_130
private boolean jj_3R_ConditionalAndExpression_2448_3_130()
-
jj_3R_FloatingPointLiteral_1678_5_104
private boolean jj_3R_FloatingPointLiteral_1678_5_104()
-
jj_3R_ConditionalOrExpression_2442_6_135
private boolean jj_3R_ConditionalOrExpression_2442_6_135()
-
jj_3R_ConditionalOrExpression_2441_3_124
private boolean jj_3R_ConditionalOrExpression_2441_3_124()
-
jj_3R_Comment_1668_5_74
private boolean jj_3R_Comment_1668_5_74()
-
jj_3R_Comment_1667_5_73
private boolean jj_3R_Comment_1667_5_73()
-
jj_3R_Comment_1666_2_72
private boolean jj_3R_Comment_1666_2_72()
-
jj_3R_Comment_1666_2_48
private boolean jj_3R_Comment_1666_2_48()
-
jj_3R_Expression_2429_1_109
private boolean jj_3R_Expression_2429_1_109()
-
jj_3_11
private boolean jj_3_11()
-
jj_3_23
private boolean jj_3_23()
-
jj_3_10
private boolean jj_3_10()
-
jj_3_4
private boolean jj_3_4()
-
jj_3_9
private boolean jj_3_9()
-
jj_3_22
private boolean jj_3_22()
-
jj_3_8
private boolean jj_3_8()
-
jj_3R_EndingZeroWidthWhitespace_1586_5_49
private boolean jj_3R_EndingZeroWidthWhitespace_1586_5_49()
-
jj_3_3
private boolean jj_3_3()
-
jj_3_2
private boolean jj_3_2()
-
jj_3_1
private boolean jj_3_1()
-
jj_3_21
private boolean jj_3_21()
-
jj_3_7
private boolean jj_3_7()
-
jj_la1_init_0
private static void jj_la1_init_0()
-
jj_la1_init_1
private static void jj_la1_init_1()
-
jj_la1_init_2
private static void jj_la1_init_2()
-
ReInit
public void ReInit(CharStream stream)
Reinitialise.
-
ReInit
public void ReInit(StandardParserTokenManager tm)
Reinitialise.
-
jj_consume_token
private Token jj_consume_token(int kind) throws ParseException
- Throws:
ParseException
-
jj_scan_token
private boolean jj_scan_token(int kind)
-
getNextToken
public final Token getNextToken()
Get the next Token.
-
getToken
public final Token getToken(int index)
Get the specific Token.
-
jj_ntk_f
private int jj_ntk_f()
-
jj_add_error_token
private void jj_add_error_token(int kind, int pos)
-
generateParseException
public ParseException generateParseException()
Generate ParseException.
-
trace_enabled
public final boolean trace_enabled()
Trace enabled.
-
enable_tracing
public final void enable_tracing()
Enable tracing.
-
disable_tracing
public final void disable_tracing()
Disable tracing.
-
jj_rescan_token
private void jj_rescan_token()
-
jj_save
private void jj_save(int index, int xla)
-
-