freemarker.template.compiler
Class FMParser

java.lang.Object
  |
  +--freemarker.template.compiler.FMParser
All Implemented Interfaces:
FMParserConstants

public class FMParser
extends java.lang.Object
implements FMParserConstants

This class is generated by JavaCC from a grammar file.


Field Summary
 Token jj_nt
           
 boolean lookingAhead
           
 Token token
           
 FMParserTokenManager token_source
           
 
Fields inherited from interface freemarker.template.compiler.FMParserConstants
AND, ASSIGN, BLANK, BREAK, BUILT_IN, CALL, CASE, CLOSE_BRACE, CLOSE_BRACKET, CLOSE_PAREN, CLOSE_TAG, COLON, COMMA, COMMENT, COMPRESS, DECIMAL, DEFAUL, DEFAULT, DIRECTIVE_END, DIVIDE, DOT, DOT_DOT, ELSE, ELSE_IF, END_COMPRESS, END_FOREACH, END_FUNCTION, END_IF, END_LIST, END_SWITCH, END_TAG, END_TRANSFORM, EOF, EQUALS, ESCAPED_GT, ESCAPED_GTE, FALSE, FALSE_ALERT, FM_EXPRESSION, FOREACH, FUNCTION, ID, IF, IGNORE_TAG, IN_PAREN, INCLUDE, INTEGER, INTEGER_DOT_DOT, KEEP_GOING, LESS_THAN, LESS_THAN_EQUALS, LIST, LOCALE, MAYBE_END, MINUS, NATURAL_GT, NATURAL_GTE, NO_PARSE, NOPARSE, NOT, NOT_EQUALS, NUMERICAL_ESCAPE, OPEN_BRACE, OPEN_BRACKET, OPEN_PAREN, OR, OUTPUT_ESCAPE, PCDATA, PERCENT, PLUS, RETURN, SEMICOLON, START_TAG, STOP, STRING_LITERAL, SWITCH, TIMES, tokenImage, TRANSFORM, TRUE
 
Constructor Summary
FMParser(FMParserTokenManager tm)
           
FMParser(java.io.InputStream stream)
           
FMParser(java.io.Reader stream)
           
FMParser(Template template, java.io.Reader reader)
           
 
Method Summary
 Expression AdditiveExpression()
           
 Expression AddSubExpression(Expression exp)
          Production that builds up an expression using the dot or dynamic key name or the args list if this is a method invocation.
 Expression AndExpression()
           
 freemarker.template.compiler.MethodCall ArgList(Expression target)
           
 TemplateElement Assign()
           
 freemarker.template.compiler.BreakInstruction Break()
          Production used to break out of a loop or a switch block.
 Expression BuiltIn(Expression exp)
           
 freemarker.template.compiler.FunctionCall Call()
           
 freemarker.template.compiler.Case Case()
           
 freemarker.template.compiler.Comment Comment()
           
 Expression Comparison()
          An AdditiveExpression followed by zero or more equality subexpressions
 freemarker.template.compiler.CompressedBlock Compress()
           
 void ConsumeWhiteSpace()
          Consumes any meaningless whitespace between this point and the next Freemarker directive.
 TemplateElement Content()
           
 void disable_tracing()
           
 Expression DotVariable(Expression exp)
          production for when a key is specified by + keyname
 Expression DynamicKey(Expression exp)
          production for when the key is specified in brackets.
 void enable_tracing()
           
 Expression Expression()
          This is the same as OrExpression, since the OR is the operator with the lowest precedence.
 freemarker.template.compiler.IteratorBlock ForEach()
           
 TemplateElement FreemarkerDirective()
          A production for Freemarker directives.
 Function Function()
           
 ParseException generateParseException()
           
 Token getNextToken()
           
 Token getToken(int index)
           
 freemarker.template.compiler.HashLiteral HashLiteral()
           
 freemarker.template.compiler.Identifier Identifier()
           
 freemarker.template.compiler.IfBlock If()
           
 freemarker.template.compiler.Include Include()
           
 freemarker.template.compiler.IteratorBlock List()
           
 freemarker.template.compiler.ListLiteral ListLiteral()
           
 freemarker.template.compiler.LocaleAssignment Locale()
           
static void main(java.lang.String[] args)
           
 freemarker.template.compiler.MethodCall MethodArgs(Expression exp)
          production for an arglist part of a method invocation.
 Expression MultiplicativeExpression()
          A unary expression followed by zero or more unary expressions with operators in between.
 freemarker.template.compiler.TextBlock NoParse()
           
 Expression NumberLiteral()
           
 freemarker.template.compiler.NumericalOutput NumericalOutput()
           
 TemplateElement OptionalBlock()
          A production for a block of optional content.
 Expression OrExpression()
           
 Expression Parenthesis()
           
 freemarker.template.compiler.TextBlock PCData()
          Production for a block of raw text i.e.
 Expression PrimaryExpression()
          Lowest level expression, a literal, a variable, or a possibly more complex expression bounded by parentheses.
 freemarker.template.compiler.Range RangeLiteral()
           
 void ReInit(FMParserTokenManager tm)
           
 void ReInit(java.io.InputStream stream)
           
 void ReInit(java.io.Reader stream)
           
 TemplateElement Root()
          Root production to be used when parsing an entire file.
 Expression StringLiteral()
           
 freemarker.template.compiler.DollarVariable StringOutput()
          A production representing the ${...} that outputs a variable.
 freemarker.template.compiler.SwitchBlock Switch()
           
 freemarker.template.compiler.TransformBlock Transform()
           
 Expression UnaryExpression()
          A primary expression preceded by zero or more unary operators.
 java.lang.String UnparsedContent()
          Production for dealing with unparsed content, i.e.
 Expression Variable()
           
 freemarker.template.compiler.Range VariableRange(Expression lhs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public FMParserTokenManager token_source

token

public Token token

jj_nt

public Token jj_nt

lookingAhead

public boolean lookingAhead
Constructor Detail

FMParser

public FMParser(Template template,
                java.io.Reader reader)

FMParser

public FMParser(java.io.InputStream stream)

FMParser

public FMParser(java.io.Reader stream)

FMParser

public FMParser(FMParserTokenManager tm)
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException

Expression

public final Expression Expression()
                            throws ParseException
This is the same as OrExpression, since the OR is the operator with the lowest precedence.

PrimaryExpression

public final Expression PrimaryExpression()
                                   throws ParseException
Lowest level expression, a literal, a variable, or a possibly more complex expression bounded by parentheses.

Parenthesis

public final Expression Parenthesis()
                             throws ParseException

UnaryExpression

public final Expression UnaryExpression()
                                 throws ParseException
A primary expression preceded by zero or more unary operators. (The only unary operator we currently have is the NOT.)

AdditiveExpression

public final Expression AdditiveExpression()
                                    throws ParseException

MultiplicativeExpression

public final Expression MultiplicativeExpression()
                                          throws ParseException
A unary expression followed by zero or more unary expressions with operators in between.

Comparison

public final Expression Comparison()
                            throws ParseException
An AdditiveExpression followed by zero or more equality subexpressions

AndExpression

public final Expression AndExpression()
                               throws ParseException

OrExpression

public final Expression OrExpression()
                              throws ParseException

ListLiteral

public final freemarker.template.compiler.ListLiteral ListLiteral()
                                                           throws ParseException

NumberLiteral

public final Expression NumberLiteral()
                               throws ParseException

RangeLiteral

public final freemarker.template.compiler.Range RangeLiteral()
                                                      throws ParseException

VariableRange

public final freemarker.template.compiler.Range VariableRange(Expression lhs)
                                                       throws ParseException

Identifier

public final freemarker.template.compiler.Identifier Identifier()
                                                         throws ParseException

Variable

public final Expression Variable()
                          throws ParseException

AddSubExpression

public final Expression AddSubExpression(Expression exp)
                                  throws ParseException
Production that builds up an expression using the dot or dynamic key name or the args list if this is a method invocation.

BuiltIn

public final Expression BuiltIn(Expression exp)
                         throws ParseException

DotVariable

public final Expression DotVariable(Expression exp)
                             throws ParseException
production for when a key is specified by + keyname

DynamicKey

public final Expression DynamicKey(Expression exp)
                            throws ParseException
production for when the key is specified in brackets.

MethodArgs

public final freemarker.template.compiler.MethodCall MethodArgs(Expression exp)
                                                         throws ParseException
production for an arglist part of a method invocation.

StringLiteral

public final Expression StringLiteral()
                               throws ParseException

ArgList

public final freemarker.template.compiler.MethodCall ArgList(Expression target)
                                                      throws ParseException

HashLiteral

public final freemarker.template.compiler.HashLiteral HashLiteral()
                                                           throws ParseException

StringOutput

public final freemarker.template.compiler.DollarVariable StringOutput()
                                                               throws ParseException
A production representing the ${...} that outputs a variable.

NumericalOutput

public final freemarker.template.compiler.NumericalOutput NumericalOutput()
                                                                   throws ParseException

If

public final freemarker.template.compiler.IfBlock If()
                                              throws ParseException

List

public final freemarker.template.compiler.IteratorBlock List()
                                                      throws ParseException

ForEach

public final freemarker.template.compiler.IteratorBlock ForEach()
                                                         throws ParseException

Break

public final freemarker.template.compiler.BreakInstruction Break()
                                                          throws ParseException
Production used to break out of a loop or a switch block. The stop instruction terminates the rendering of the template.

Assign

public final TemplateElement Assign()
                             throws ParseException

Include

public final freemarker.template.compiler.Include Include()
                                                   throws ParseException

Function

public final Function Function()
                        throws ParseException

Compress

public final freemarker.template.compiler.CompressedBlock Compress()
                                                            throws ParseException

Call

public final freemarker.template.compiler.FunctionCall Call()
                                                     throws ParseException

Comment

public final freemarker.template.compiler.Comment Comment()
                                                   throws ParseException

NoParse

public final freemarker.template.compiler.TextBlock NoParse()
                                                     throws ParseException

Transform

public final freemarker.template.compiler.TransformBlock Transform()
                                                            throws ParseException

Switch

public final freemarker.template.compiler.SwitchBlock Switch()
                                                      throws ParseException

Case

public final freemarker.template.compiler.Case Case()
                                             throws ParseException

ConsumeWhiteSpace

public final void ConsumeWhiteSpace()
                             throws ParseException
Consumes any meaningless whitespace between this point and the next Freemarker directive. If there is non-whitespace text here, it is unexpected and we throw a ParseException

Locale

public final freemarker.template.compiler.LocaleAssignment Locale()
                                                           throws ParseException

FreemarkerDirective

public final TemplateElement FreemarkerDirective()
                                          throws ParseException
A production for Freemarker directives.

PCData

public final freemarker.template.compiler.TextBlock PCData()
                                                    throws ParseException
Production for a block of raw text i.e. text that contains no Freemarker directives.

UnparsedContent

public final java.lang.String UnparsedContent()
                                       throws ParseException
Production for dealing with unparsed content, i.e. what is inside a comment or noparse tag.

Content

public final TemplateElement Content()
                              throws ParseException

OptionalBlock

public final TemplateElement OptionalBlock()
                                    throws ParseException
A production for a block of optional content. Returns an empty Text block if there is no content.

Root

public final TemplateElement Root()
                           throws ParseException
Root production to be used when parsing an entire file.

ReInit

public void ReInit(java.io.InputStream stream)

ReInit

public void ReInit(java.io.Reader stream)

ReInit

public void ReInit(FMParserTokenManager tm)

getNextToken

public final Token getNextToken()

getToken

public final Token getToken(int index)

generateParseException

public final ParseException generateParseException()

enable_tracing

public final void enable_tracing()

disable_tracing

public final void disable_tracing()