|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |
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.
Field Summary | |
---|---|
NVelocity.Runtime.Parser.Token | jj_nt |
bool | lookingAhead |
NVelocity.Runtime.Parser.Token | token |
NVelocity.Runtime.Parser.ParserTokenManager | token_source |
Constructor Summary | |
---|---|
Parser(NVelocity.Runtime.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. |
|
Parser(NVelocity.Runtime.Parser.CharStream stream) | |
Parser(NVelocity.Runtime.Parser.ParserTokenManager tm) |
Property Summary | |
---|---|
System.Collections.Hashtable | Directives |
NVelocity.Runtime.Parser.Token | NextToken |
Method Summary | |
---|---|
void | AdditiveExpression() |
void | Assignment() |
void | Comment() |
void | ConditionalAndExpression() |
void | ConditionalOrExpression() |
NVelocity.Runtime.Parser.Node.SimpleNode |
Directive() Supports the Pluggable Directives #foo( arg+ ) |
void |
DirectiveArg() Supports the arguments for the Pluggable Directives We add whitespace in here as a token so the VMs can easily reconstruct a macro body from the token stream See Directive() |
void | disable_tracing() |
void | ElseIfStatement() |
void | ElseStatement() |
void | enable_tracing() |
void | EqualityExpression() |
void | Escape() |
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. 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. |
void | Expression() |
void | False() |
NVelocity.Runtime.Parser.ParseException | generateParseException() |
NVelocity.Runtime.Directive.Directive |
getDirective(string directive) This method gets a Directive from the directives Hashtable |
NVelocity.Runtime.Parser.Token | getToken(int index) |
void |
Identifier() 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 * |
void | IfStatement() |
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 |
bool |
isDirective(string directive) This method finds out of the directive exists in the directives Hashtable. |
void |
Method() This method has yet to be fully implemented but will allow arbitrarily nested method calls |
void | MultiplicativeExpression() |
void | NumberLiteral() |
void | ObjectArray() |
void |
Parameter() This method has yet to be fully implemented but will allow arbitrarily nested method calls |
NVelocity.Runtime.Parser.Node.SimpleNode |
parse(System.IO.TextReader reader, string templateName) 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. |
void | PrimaryExpression() |
NVelocity.Runtime.Parser.Node.SimpleNode |
process() 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 |
void | Reference() |
void | ReInit(NVelocity.Runtime.Parser.ParserTokenManager tm) |
void | ReInit(NVelocity.Runtime.Parser.CharStream stream) |
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 |
StopStatement() This method corresponds to the #stop directive which just simulates and EOF so that parsing stops. The #stop directive is useful for end-user debugging purposes. |
void | StringLiteral() |
void |
Text() This method is responsible for allowing all non-grammar text to pass through unscathed. |
void | True() |
void | UnaryExpression() |
void | Word() |
Methods inherited from class System.Object |
---|
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString |
Field Detail |
---|
public NVelocity.Runtime.Parser.Token jj_nt
public bool lookingAhead
public NVelocity.Runtime.Parser.Token token
public NVelocity.Runtime.Parser.ParserTokenManager token_source
Constructor Detail |
---|
public Parser(NVelocity.Runtime.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.
public Parser(NVelocity.Runtime.Parser.CharStream stream)
public Parser(NVelocity.Runtime.Parser.ParserTokenManager tm)
Property Detail |
---|
public System.Collections.Hashtable Directives
public NVelocity.Runtime.Parser.Token NextToken
Method Detail |
---|
public void AdditiveExpression()
public void Assignment()
public void Comment()
public void ConditionalAndExpression()
public void ConditionalOrExpression()
public NVelocity.Runtime.Parser.Node.SimpleNode Directive()
Supports the Pluggable Directives #foo( arg+ )
public void DirectiveArg()
Supports the arguments for the Pluggable Directives We add whitespace in here as a token so the VMs can easily reconstruct a macro body from the token stream See Directive()
public void disable_tracing()
public void ElseIfStatement()
public void ElseStatement()
public void enable_tracing()
public void EqualityExpression()
public void Escape()
public 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. 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.
public void Expression()
public void False()
public NVelocity.Runtime.Parser.ParseException generateParseException()
public NVelocity.Runtime.Directive.Directive getDirective(string directive)
This method gets a Directive from the directives Hashtable
public NVelocity.Runtime.Parser.Token getToken(int index)
public void Identifier()
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 *
public void IfStatement()
public 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
public bool isDirective(string directive)
This method finds out of the directive exists in the directives Hashtable.
public void Method()
This method has yet to be fully implemented but will allow arbitrarily nested method calls
public void MultiplicativeExpression()
public void NumberLiteral()
public void ObjectArray()
public void Parameter()
This method has yet to be fully implemented but will allow arbitrarily nested method calls
public NVelocity.Runtime.Parser.Node.SimpleNode parse(System.IO.TextReader reader, string templateName)
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.
public void PrimaryExpression()
public NVelocity.Runtime.Parser.Node.SimpleNode process()
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
public void Reference()
public void ReInit(NVelocity.Runtime.Parser.ParserTokenManager tm)
public void ReInit(NVelocity.Runtime.Parser.CharStream stream)
public void RelationalExpression()
public void SetDirective()
Currently support both types of set : #set( expr ) #set expr
public void Statement()
These are the types of statements that are acceptable in Velocity templates.
public void StopStatement()
This method corresponds to the #stop directive which just simulates and EOF so that parsing stops. The #stop directive is useful for end-user debugging purposes.
public void StringLiteral()
public void Text()
This method is responsible for allowing all non-grammar text to pass through unscathed.
public void True()
public void UnaryExpression()
public void Word()
|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |