C# 클래스 NVelocity.Runtime.Parser.Parser

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.
파일 보기 프로젝트 열기: rasmus-toftdahl-olesen/NVelocity 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
lookingAhead bool
token Token
token_source ParserTokenManager

보호된 프로퍼티들

프로퍼티 타입 설명
directiveStack Stack

공개 메소드들

메소드 설명
AdditiveExpression ( ) : void
Assignment ( ) : void
Comment ( ) : void
ConditionalAndExpression ( ) : void
ConditionalOrExpression ( ) : void
Directive ( ) : NVelocity.Runtime.Parser.Node.SimpleNode

Supports the Pluggable Directives #foo( arg+ )

DirectiveArg ( ) : void

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()

ElseIfStatement ( ) : void
ElseStatement ( ) : void
EqualityExpression ( ) : void
Escape ( ) : void

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

EscapedDirective ( ) : void

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.

Expression ( ) : void
False ( ) : void
GenerateParseException ( ) : ParseException
GetToken ( int index ) : Token
Identifier ( ) : void

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 *

IfStatement ( ) : void
IntegerRange ( ) : void

supports the [n..m] vector generator for use in the #foreach() to generate measured ranges w/o needing explicit support from the app/servlet

IsDirective ( String directive ) : bool

This method finds out of the directive exists in the directives Hashtable.

Method ( ) : void

This method has yet to be fully implemented but will allow arbitrarily nested method calls

MultiplicativeExpression ( ) : void
NumberLiteral ( ) : void
ObjectArray ( ) : void
Parameter ( ) : void

This method has yet to be fully implemented but will allow arbitrarily nested method calls

Parse ( TextReader reader, String templateName ) : NVelocity.Runtime.Parser.Node.SimpleNode

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.

Parser ( ICharStream stream ) : System
Parser ( IRuntimeServices rs ) : System

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 ( ParserTokenManager tm ) : System
PrimaryExpression ( ) : void
Process ( ) : NVelocity.Runtime.Parser.Node.SimpleNode

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

ReInit ( ICharStream stream ) : void
ReInit ( ParserTokenManager tm ) : void
Reference ( ) : void
RelationalExpression ( ) : void
SetDirective ( ) : void

Currently support both types of set : #set( expr ) #set expr

Statement ( ) : void

These are the types of statements that are acceptable in Velocity templates.

StopStatement ( ) : void

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.

StringLiteral ( ) : void
Text ( ) : void

This method is responsible for allowing all non-grammar text to pass through unscathed.

True ( ) : void
UnaryExpression ( ) : void
Word ( ) : void

비공개 메소드들

메소드 설명
AddErrorToken ( int kind, int position ) : void
ConsumeToken ( int kind ) : Token
ConsumeWhiteSpaces ( ) : void
EscapedDirective ( String strImage ) : String

Produces a processed output for an escaped control or pluggable directive

GetCurrentTokenKind ( ) : int
InitBlock ( ) : void
RescanToken ( ) : void
Save ( int index, int xla ) : void
ScanToken ( int kind ) : bool
ToRefactor1 ( ) : bool
jj_2_1 ( int xla ) : bool
jj_2_10 ( int xla ) : bool
jj_2_11 ( int xla ) : bool
jj_2_12 ( int xla ) : bool
jj_2_2 ( int xla ) : bool
jj_2_3 ( int xla ) : bool
jj_2_4 ( int xla ) : bool
jj_2_5 ( int xla ) : bool
jj_2_6 ( int xla ) : bool
jj_2_7 ( int xla ) : bool
jj_2_8 ( int xla ) : bool
jj_2_9 ( int xla ) : bool
jj_3R_100 ( int ge, bool r_91 ) : bool
jj_3R_101 ( ) : bool
jj_3R_19 ( ) : bool
jj_3R_29 ( ) : bool
jj_3R_31 ( ) : bool
jj_3R_33 ( ) : bool
jj_3R_38 ( ) : bool
jj_3R_39 ( ) : bool
jj_3R_40 ( ) : bool
jj_3R_41 ( ) : bool
jj_3R_42 ( ) : bool
jj_3R_50 ( bool b ) : bool
jj_3R_51 ( ) : bool
jj_3R_52 ( ) : bool
jj_3R_54 ( ) : bool
jj_3R_55 ( ) : bool
jj_3R_56 ( ) : bool
jj_3R_57 ( ) : bool
jj_3R_58 ( ) : bool
jj_3R_59 ( ) : bool
jj_3R_60 ( ) : bool
jj_3R_77 ( ) : bool
jj_3R_81 ( ) : bool
jj_3R_82 ( ) : bool
jj_3R_84 ( ) : bool
jj_3R_86 ( ) : bool
jj_3R_89 ( ) : bool
jj_3R_90 ( ) : bool
jj_3R_91 ( ) : bool
jj_3R_92 ( ) : bool
jj_3R_95 ( ) : bool
jj_3R_96 ( ) : bool
jj_3_10 ( ) : bool
jj_3_11 ( ) : bool
jj_3_12 ( ) : bool
jj_3_2 ( ) : bool
jj_3_3 ( ) : bool
jj_3_4 ( ) : bool
jj_3_7 ( ) : bool
jj_ntk ( ) : int

메소드 상세

AdditiveExpression() 공개 메소드

public AdditiveExpression ( ) : void
리턴 void

Assignment() 공개 메소드

public Assignment ( ) : void
리턴 void

Comment() 공개 메소드

public Comment ( ) : void
리턴 void

ConditionalAndExpression() 공개 메소드

public ConditionalAndExpression ( ) : void
리턴 void

ConditionalOrExpression() 공개 메소드

public ConditionalOrExpression ( ) : void
리턴 void

Directive() 공개 메소드

Supports the Pluggable Directives #foo( arg+ )
public Directive ( ) : NVelocity.Runtime.Parser.Node.SimpleNode
리턴 NVelocity.Runtime.Parser.Node.SimpleNode

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 DirectiveArg ( ) : void
리턴 void

ElseIfStatement() 공개 메소드

public ElseIfStatement ( ) : void
리턴 void

ElseStatement() 공개 메소드

public ElseStatement ( ) : void
리턴 void

EqualityExpression() 공개 메소드

public EqualityExpression ( ) : void
리턴 void

Escape() 공개 메소드

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
public Escape ( ) : void
리턴 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 EscapedDirective ( ) : void
리턴 void

Expression() 공개 메소드

public Expression ( ) : void
리턴 void

False() 공개 메소드

public False ( ) : void
리턴 void

GenerateParseException() 공개 메소드

public GenerateParseException ( ) : ParseException
리턴 ParseException

GetToken() 공개 메소드

public GetToken ( int index ) : Token
index int
리턴 Token

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 Identifier ( ) : void
리턴 void

IfStatement() 공개 메소드

public IfStatement ( ) : void
리턴 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 IntegerRange ( ) : void
리턴 void

IsDirective() 공개 메소드

This method finds out of the directive exists in the directives Hashtable.
public IsDirective ( String directive ) : bool
directive String
리턴 bool

Method() 공개 메소드

This method has yet to be fully implemented but will allow arbitrarily nested method calls
public Method ( ) : void
리턴 void

MultiplicativeExpression() 공개 메소드

public MultiplicativeExpression ( ) : void
리턴 void

NumberLiteral() 공개 메소드

public NumberLiteral ( ) : void
리턴 void

ObjectArray() 공개 메소드

public ObjectArray ( ) : void
리턴 void

Parameter() 공개 메소드

This method has yet to be fully implemented but will allow arbitrarily nested method calls
public Parameter ( ) : void
리턴 void

Parse() 공개 메소드

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 Parse ( TextReader reader, String templateName ) : NVelocity.Runtime.Parser.Node.SimpleNode
reader System.IO.TextReader
templateName String
리턴 NVelocity.Runtime.Parser.Node.SimpleNode

Parser() 공개 메소드

public Parser ( ICharStream stream ) : System
stream ICharStream
리턴 System

Parser() 공개 메소드

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 ( IRuntimeServices rs ) : System
rs IRuntimeServices
리턴 System

Parser() 공개 메소드

public Parser ( ParserTokenManager tm ) : System
tm ParserTokenManager
리턴 System

PrimaryExpression() 공개 메소드

public PrimaryExpression ( ) : void
리턴 void

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 Process ( ) : NVelocity.Runtime.Parser.Node.SimpleNode
리턴 NVelocity.Runtime.Parser.Node.SimpleNode

ReInit() 공개 메소드

public ReInit ( ICharStream stream ) : void
stream ICharStream
리턴 void

ReInit() 공개 메소드

public ReInit ( ParserTokenManager tm ) : void
tm ParserTokenManager
리턴 void

Reference() 공개 메소드

public Reference ( ) : void
리턴 void

RelationalExpression() 공개 메소드

public RelationalExpression ( ) : void
리턴 void

SetDirective() 공개 메소드

Currently support both types of set : #set( expr ) #set expr
public SetDirective ( ) : void
리턴 void

Statement() 공개 메소드

These are the types of statements that are acceptable in Velocity templates.
public Statement ( ) : void
리턴 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 StopStatement ( ) : void
리턴 void

StringLiteral() 공개 메소드

public StringLiteral ( ) : void
리턴 void

Text() 공개 메소드

This method is responsible for allowing all non-grammar text to pass through unscathed.
public Text ( ) : void
리턴 void

True() 공개 메소드

public True ( ) : void
리턴 void

UnaryExpression() 공개 메소드

public UnaryExpression ( ) : void
리턴 void

Word() 공개 메소드

public Word ( ) : void
리턴 void

프로퍼티 상세

directiveStack 보호되어 있는 프로퍼티

protected Stack directiveStack
리턴 Stack

lookingAhead 공개적으로 프로퍼티

public bool lookingAhead
리턴 bool

token 공개적으로 프로퍼티

public Token,NVelocity.Runtime.Parser token
리턴 Token

token_source 공개적으로 프로퍼티

public ParserTokenManager,NVelocity.Runtime.Parser token_source
리턴 ParserTokenManager