Package net.sourceforge.pmd.lang.vm.ast
Class VmParser
- java.lang.Object
-
- net.sourceforge.pmd.lang.vm.ast.VmParser
-
- All Implemented Interfaces:
VmParserConstants
,VmParserTreeConstants
@Deprecated @InternalApi public class VmParser extends Object implements VmParserTreeConstants, VmParserConstants
Deprecated.This class is responsible for parsing a Velocity template. This class was generated by JavaCC using the JJTree extension to produce an Abstract Syntax Tree (AST) of the template. Please look at the Parser.jjt file which is what controls the generation of this class.- Version:
- $Id$
- Author:
- Jason van Zyl, Geir Magnusson Jr., Henning P. Schmiedehausen
-
-
Field Summary
Fields Modifier and Type Field Description String
currentTemplateName
Deprecated.Name of current template we are parsing.Token
jj_nt
Deprecated.Next token.protected JJTVmParserState
jjtree
Deprecated.boolean
strictEscape
Deprecated.Set to true if the property RuntimeConstants.RUNTIME_REFERENCES_STRICT_ESCAPE is set to trueToken
token
Deprecated.Current token.VmParserTokenManager
token_source
Deprecated.Generated Token Manager.-
Fields inherited from interface net.sourceforge.pmd.lang.vm.ast.VmParserConstants
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, 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
-
Fields inherited from interface net.sourceforge.pmd.lang.vm.ast.VmParserTreeConstants
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, JJTWORD
-
-
Constructor Summary
Constructors Constructor Description VmParser(CharStream stream)
Deprecated.Constructor with user supplied CharStream.VmParser(VmParserTokenManager tm)
Deprecated.Constructor with generated Token Manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
AdditiveExpression()
Deprecated.void
Assignment()
Deprecated.void
Comment()
Deprecated.void
ConditionalAndExpression()
Deprecated.void
ConditionalOrExpression()
Deprecated.VmNode
Directive()
Deprecated.Supports the Pluggable Directives #foo( arg+ )int
DirectiveArg()
Deprecated.Supports the arguments for the Pluggable Directivesvoid
disable_tracing()
Deprecated.Disable tracing.void
ElseIfStatement()
Deprecated.void
ElseStatement()
Deprecated.void
enable_tracing()
Deprecated.Enable tracing.void
EqualityExpression()
Deprecated.void
Escape()
Deprecated.Used to catch and process escape sequences in grammatical constructs as escapes outside of VTL are just characters.void
EscapedDirective()
Deprecated.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()
Deprecated.void
False()
Deprecated.void
FloatingPointLiteral()
Deprecated.void
ForeachStatement()
Deprecated.ParseException
generateParseException()
Deprecated.Generate ParseException.Directive
getDirective(String directive)
Deprecated.This method gets a Directive from the directives HashtableToken
getNextToken()
Deprecated.Get the next Token.Token
getToken(int index)
Deprecated.Get the specific Token.void
Identifier()
Deprecated.This method corresponds to variable references in Velocity templates.void
IfStatement()
Deprecated.void
Index()
Deprecated.void
IndexParameter()
Deprecated.A Simplified parameter more suitable for an index position: $foo[$index]void
IntegerLiteral()
Deprecated.void
IntegerRange()
Deprecated.supports the [n..m] vector generator for use in the #foreach() to generate measured ranges w/o needing explicit support from the app/servletboolean
isDirective(String directive)
Deprecated.This method finds out of the directive exists in the directives Map.void
Map()
Deprecated.for creating a map in a #set #set($foo = {$foo : $bar, $blargh : $thingy})void
Method()
Deprecated.This method has yet to be fully implemented but will allow arbitrarily nested method callsvoid
MultiplicativeExpression()
Deprecated.void
ObjectArray()
Deprecated.void
Parameter()
Deprecated.This method has yet to be fully implemented but will allow arbitrarily nested method callsvoid
PrimaryExpression()
Deprecated.ASTprocess
process()
Deprecated.This method is what starts the whole parsing process.void
Reference()
Deprecated.void
ReInit(CharStream stream)
Deprecated.Reinitialise.void
ReInit(VmParserTokenManager tm)
Deprecated.Reinitialise.void
RelationalExpression()
Deprecated.void
SetDirective()
Deprecated.Currently support both types of set : #set( expr ) #set exprvoid
Statement()
Deprecated.These are the types of statements that are acceptable in Velocity templates.void
StringLiteral()
Deprecated.void
Text()
Deprecated.This method is responsible for allowing all non-grammar text to pass through unscathed.void
Textblock()
Deprecated.void
True()
Deprecated.void
UnaryExpression()
Deprecated.void
Word()
Deprecated.
-
-
-
Field Detail
-
jjtree
protected JJTVmParserState jjtree
Deprecated.
-
currentTemplateName
public String currentTemplateName
Deprecated.Name of current template we are parsing. Passed to us in parse()
-
strictEscape
public boolean strictEscape
Deprecated.Set to true if the property RuntimeConstants.RUNTIME_REFERENCES_STRICT_ESCAPE is set to true
-
token_source
public VmParserTokenManager token_source
Deprecated.Generated Token Manager.
-
token
public Token token
Deprecated.Current token.
-
jj_nt
public Token jj_nt
Deprecated.Next token.
-
-
Constructor Detail
-
VmParser
public VmParser(CharStream stream)
Deprecated.Constructor with user supplied CharStream.
-
VmParser
public VmParser(VmParserTokenManager tm)
Deprecated.Constructor with generated Token Manager.
-
-
Method Detail
-
getDirective
public Directive getDirective(String directive)
Deprecated.This method gets a Directive from the directives Hashtable
-
isDirective
public boolean isDirective(String directive)
Deprecated.This method finds out of the directive exists in the directives Map.
-
process
public final ASTprocess process() throws ParseException
Deprecated.This method is what starts the whole parsing process. After the parsing is complete and the template 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 void Statement() throws ParseException
Deprecated.These are the types of statements that are acceptable in Velocity templates.- Throws:
ParseException
-
EscapedDirective
public final void EscapedDirective() throws ParseException
Deprecated.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
Deprecated.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 void Comment() throws ParseException
Deprecated.- Throws:
ParseException
-
Textblock
public final void Textblock() throws ParseException
Deprecated.- Throws:
ParseException
-
FloatingPointLiteral
public final void FloatingPointLiteral() throws ParseException
Deprecated.- Throws:
ParseException
-
IntegerLiteral
public final void IntegerLiteral() throws ParseException
Deprecated.- Throws:
ParseException
-
StringLiteral
public final void StringLiteral() throws ParseException
Deprecated.- Throws:
ParseException
-
Identifier
public final void Identifier() throws ParseException
Deprecated.This method corresponds to variable references in Velocity templates. The following are examples of variable references that may be found in a template: $foo $bar- Throws:
ParseException
-
Word
public final void Word() throws ParseException
Deprecated.- Throws:
ParseException
-
DirectiveArg
public final int DirectiveArg() throws ParseException
Deprecated.Supports the arguments for the Pluggable Directives- Throws:
ParseException
-
Directive
public final VmNode Directive() throws ParseException
Deprecated.Supports the Pluggable Directives #foo( arg+ )- Throws:
ParseException
-
Map
public final void Map() throws ParseException
Deprecated.for creating a map in a #set #set($foo = {$foo : $bar, $blargh : $thingy})- Throws:
ParseException
-
ObjectArray
public final void ObjectArray() throws ParseException
Deprecated.- Throws:
ParseException
-
IntegerRange
public final void IntegerRange() throws ParseException
Deprecated.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
Deprecated.A Simplified parameter more suitable for an index position: $foo[$index]- Throws:
ParseException
-
Parameter
public final void Parameter() throws ParseException
Deprecated.This method has yet to be fully implemented but will allow arbitrarily nested method calls- Throws:
ParseException
-
Method
public final void Method() throws ParseException
Deprecated.This method has yet to be fully implemented but will allow arbitrarily nested method calls- Throws:
ParseException
-
Index
public final void Index() throws ParseException
Deprecated.- Throws:
ParseException
-
Reference
public final void Reference() throws ParseException
Deprecated.- Throws:
ParseException
-
True
public final void True() throws ParseException
Deprecated.- Throws:
ParseException
-
False
public final void False() throws ParseException
Deprecated.- Throws:
ParseException
-
Text
public final void Text() throws ParseException
Deprecated.This method is responsible for allowing all non-grammar text to pass through unscathed.- Throws:
ParseException
-
ForeachStatement
public final void ForeachStatement() throws ParseException
Deprecated.- Throws:
ParseException
-
IfStatement
public final void IfStatement() throws ParseException
Deprecated.- Throws:
ParseException
-
ElseStatement
public final void ElseStatement() throws ParseException
Deprecated.- Throws:
ParseException
-
ElseIfStatement
public final void ElseIfStatement() throws ParseException
Deprecated.- Throws:
ParseException
-
SetDirective
public final void SetDirective() throws ParseException
Deprecated.Currently support both types of set : #set( expr ) #set expr- Throws:
ParseException
-
Expression
public final void Expression() throws ParseException
Deprecated.- Throws:
ParseException
-
Assignment
public final void Assignment() throws ParseException
Deprecated.- Throws:
ParseException
-
ConditionalOrExpression
public final void ConditionalOrExpression() throws ParseException
Deprecated.- Throws:
ParseException
-
ConditionalAndExpression
public final void ConditionalAndExpression() throws ParseException
Deprecated.- Throws:
ParseException
-
EqualityExpression
public final void EqualityExpression() throws ParseException
Deprecated.- Throws:
ParseException
-
RelationalExpression
public final void RelationalExpression() throws ParseException
Deprecated.- Throws:
ParseException
-
AdditiveExpression
public final void AdditiveExpression() throws ParseException
Deprecated.- Throws:
ParseException
-
MultiplicativeExpression
public final void MultiplicativeExpression() throws ParseException
Deprecated.- Throws:
ParseException
-
UnaryExpression
public final void UnaryExpression() throws ParseException
Deprecated.- Throws:
ParseException
-
PrimaryExpression
public final void PrimaryExpression() throws ParseException
Deprecated.- Throws:
ParseException
-
ReInit
public void ReInit(CharStream stream)
Deprecated.Reinitialise.
-
ReInit
public void ReInit(VmParserTokenManager tm)
Deprecated.Reinitialise.
-
getNextToken
public final Token getNextToken()
Deprecated.Get the next Token.
-
getToken
public final Token getToken(int index)
Deprecated.Get the specific Token.
-
generateParseException
public ParseException generateParseException()
Deprecated.Generate ParseException.
-
enable_tracing
public final void enable_tracing()
Deprecated.Enable tracing.
-
disable_tracing
public final void disable_tracing()
Deprecated.Disable tracing.
-
-