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 StringcurrentTemplateNameDeprecated.Name of current template we are parsing.Tokenjj_ntDeprecated.Next token.protected JJTVmParserStatejjtreeDeprecated.booleanstrictEscapeDeprecated.Set to true if the property RuntimeConstants.RUNTIME_REFERENCES_STRICT_ESCAPE is set to trueTokentokenDeprecated.Current token.VmParserTokenManagertoken_sourceDeprecated.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(net.sourceforge.pmd.lang.ast.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 voidAdditiveExpression()Deprecated.voidAssignment()Deprecated.voidComment()Deprecated.voidConditionalAndExpression()Deprecated.voidConditionalOrExpression()Deprecated.VmNodeDirective()Deprecated.Supports the Pluggable Directives #foo( arg+ )intDirectiveArg()Deprecated.Supports the arguments for the Pluggable Directivesvoiddisable_tracing()Deprecated.Disable tracing.voidElseIfStatement()Deprecated.voidElseStatement()Deprecated.voidenable_tracing()Deprecated.Enable tracing.voidEqualityExpression()Deprecated.voidEscape()Deprecated.Used to catch and process escape sequences in grammatical constructs as escapes outside of VTL are just characters.voidEscapedDirective()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.voidExpression()Deprecated.voidFalse()Deprecated.voidFloatingPointLiteral()Deprecated.voidForeachStatement()Deprecated.ParseExceptiongenerateParseException()Deprecated.Generate ParseException.DirectivegetDirective(String directive)Deprecated.This method gets a Directive from the directives HashtableTokengetNextToken()Deprecated.Get the next Token.TokengetToken(int index)Deprecated.Get the specific Token.voidIdentifier()Deprecated.This method corresponds to variable references in Velocity templates.voidIfStatement()Deprecated.voidIndex()Deprecated.voidIndexParameter()Deprecated.A Simplified parameter more suitable for an index position: $foo[$index]voidIntegerLiteral()Deprecated.voidIntegerRange()Deprecated.supports the [n..m] vector generator for use in the #foreach() to generate measured ranges w/o needing explicit support from the app/servletbooleanisDirective(String directive)Deprecated.This method finds out of the directive exists in the directives Map.voidMap()Deprecated.for creating a map in a #set #set($foo = {$foo : $bar, $blargh : $thingy})voidMethod()Deprecated.This method has yet to be fully implemented but will allow arbitrarily nested method callsvoidMultiplicativeExpression()Deprecated.voidObjectArray()Deprecated.voidParameter()Deprecated.This method has yet to be fully implemented but will allow arbitrarily nested method callsvoidPrimaryExpression()Deprecated.ASTprocessprocess()Deprecated.This method is what starts the whole parsing process.voidReference()Deprecated.voidReInit(net.sourceforge.pmd.lang.ast.CharStream stream)Deprecated.Reinitialise.voidReInit(VmParserTokenManager tm)Deprecated.Reinitialise.voidRelationalExpression()Deprecated.voidSetDirective()Deprecated.Currently support both types of set : #set( expr ) #set exprvoidStatement()Deprecated.These are the types of statements that are acceptable in Velocity templates.voidStringLiteral()Deprecated.voidText()Deprecated.This method is responsible for allowing all non-grammar text to pass through unscathed.voidTextblock()Deprecated.voidTrue()Deprecated.voidUnaryExpression()Deprecated.voidWord()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(net.sourceforge.pmd.lang.ast.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 ParseExceptionDeprecated.These are the types of statements that are acceptable in Velocity templates.- Throws:
ParseException
-
EscapedDirective
public final void EscapedDirective() throws ParseExceptionDeprecated.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 ParseExceptionDeprecated.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 ParseExceptionDeprecated.- Throws:
ParseException
-
Textblock
public final void Textblock() throws ParseExceptionDeprecated.- Throws:
ParseException
-
FloatingPointLiteral
public final void FloatingPointLiteral() throws ParseExceptionDeprecated.- Throws:
ParseException
-
IntegerLiteral
public final void IntegerLiteral() throws ParseExceptionDeprecated.- Throws:
ParseException
-
StringLiteral
public final void StringLiteral() throws ParseExceptionDeprecated.- Throws:
ParseException
-
Identifier
public final void Identifier() throws ParseExceptionDeprecated.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 ParseExceptionDeprecated.- Throws:
ParseException
-
DirectiveArg
public final int DirectiveArg() throws ParseExceptionDeprecated.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 ParseExceptionDeprecated.for creating a map in a #set #set($foo = {$foo : $bar, $blargh : $thingy})- Throws:
ParseException
-
ObjectArray
public final void ObjectArray() throws ParseExceptionDeprecated.- Throws:
ParseException
-
IntegerRange
public final void IntegerRange() throws ParseExceptionDeprecated.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 ParseExceptionDeprecated.A Simplified parameter more suitable for an index position: $foo[$index]- Throws:
ParseException
-
Parameter
public final void Parameter() throws ParseExceptionDeprecated.This method has yet to be fully implemented but will allow arbitrarily nested method calls- Throws:
ParseException
-
Method
public final void Method() throws ParseExceptionDeprecated.This method has yet to be fully implemented but will allow arbitrarily nested method calls- Throws:
ParseException
-
Index
public final void Index() throws ParseExceptionDeprecated.- Throws:
ParseException
-
Reference
public final void Reference() throws ParseExceptionDeprecated.- Throws:
ParseException
-
True
public final void True() throws ParseExceptionDeprecated.- Throws:
ParseException
-
False
public final void False() throws ParseExceptionDeprecated.- Throws:
ParseException
-
Text
public final void Text() throws ParseExceptionDeprecated.This method is responsible for allowing all non-grammar text to pass through unscathed.- Throws:
ParseException
-
ForeachStatement
public final void ForeachStatement() throws ParseExceptionDeprecated.- Throws:
ParseException
-
IfStatement
public final void IfStatement() throws ParseExceptionDeprecated.- Throws:
ParseException
-
ElseStatement
public final void ElseStatement() throws ParseExceptionDeprecated.- Throws:
ParseException
-
ElseIfStatement
public final void ElseIfStatement() throws ParseExceptionDeprecated.- Throws:
ParseException
-
SetDirective
public final void SetDirective() throws ParseExceptionDeprecated.Currently support both types of set : #set( expr ) #set expr- Throws:
ParseException
-
Expression
public final void Expression() throws ParseExceptionDeprecated.- Throws:
ParseException
-
Assignment
public final void Assignment() throws ParseExceptionDeprecated.- Throws:
ParseException
-
ConditionalOrExpression
public final void ConditionalOrExpression() throws ParseExceptionDeprecated.- Throws:
ParseException
-
ConditionalAndExpression
public final void ConditionalAndExpression() throws ParseExceptionDeprecated.- Throws:
ParseException
-
EqualityExpression
public final void EqualityExpression() throws ParseExceptionDeprecated.- Throws:
ParseException
-
RelationalExpression
public final void RelationalExpression() throws ParseExceptionDeprecated.- Throws:
ParseException
-
AdditiveExpression
public final void AdditiveExpression() throws ParseExceptionDeprecated.- Throws:
ParseException
-
MultiplicativeExpression
public final void MultiplicativeExpression() throws ParseExceptionDeprecated.- Throws:
ParseException
-
UnaryExpression
public final void UnaryExpression() throws ParseExceptionDeprecated.- Throws:
ParseException
-
PrimaryExpression
public final void PrimaryExpression() throws ParseExceptionDeprecated.- Throws:
ParseException
-
ReInit
public void ReInit(net.sourceforge.pmd.lang.ast.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.
-
-