public class FMParser extends Object implements FMParserConstants
| Modifier and Type | Field and Description |
|---|---|
Token |
jj_nt
Next token.
|
Token |
token
Current token.
|
FMParserTokenManager |
token_source
Generated Token Manager.
|
_INCLUDE, AND, AS, ASCII_DIGIT, ASSIGN, ATTEMPT, BLANK, BREAK, BUILT_IN, CALL, CASE, CLOSE_BRACKET, CLOSE_PAREN, CLOSE_TAG1, CLOSE_TAG2, CLOSING_CURLY_BRACKET, COLON, COMMA, COMMENT, COMPRESS, DECIMAL, DEFAUL, DEFAULT, DIRECTIVE_END, DIV_EQUALS, DIVIDE, DOLLAR_INTERPOLATION_OPENING, DOT, DOT_DOT, DOT_DOT_ASTERISK, DOT_DOT_LESS, DOUBLE_EQUALS, DOUBLE_STAR, ELLIPSIS, ELSE, ELSE_IF, EMPTY_DIRECTIVE_END, END_ASSIGN, END_ATTEMPT, END_COMPRESS, END_ESCAPE, END_FOREACH, END_FUNCTION, END_GLOBAL, END_IF, END_ITEMS, END_LIST, END_LOCAL, END_MACRO, END_NOESCAPE, END_RECOVER, END_SEP, END_SWITCH, END_TAG, END_TRANSFORM, EOF, EQUALS, ESCAPE, ESCAPED_CHAR, ESCAPED_GT, ESCAPED_GTE, ESCAPED_ID_CHAR, EXCLAM, EXISTS, EXPRESSION_COMMENT, FALLBACK, FALSE, FLUSH, FM_EXPRESSION, FOREACH, FTL_HEADER, FUNCTION, GLOBALASSIGN, HALT, HASH_INTERPOLATION_OPENING, ID, ID_START_CHAR, IF, IMPORT, IN, IN_PAREN, INTEGER, ITEMS, KEEP_GOING, LESS_THAN, LESS_THAN_EQUALS, LIST, LOCALASSIGN, LONE_LESS_THAN_OR_DASH, LTRIM, MACRO, MAYBE_END, MINUS, MINUS_EQUALS, MINUS_MINUS, MOD_EQUALS, NAMED_PARAMETER_EXPRESSION, NATURAL_GT, NATURAL_GTE, NESTED, NO_PARSE, NO_SPACE_EXPRESSION, NODIRECTIVE, NOESCAPE, NON_ESCAPED_ID_START_CHAR, NOPARSE, NOT_EQUALS, NOTRIM, OPEN_BRACKET, OPEN_MISPLACED_INTERPOLATION, OPEN_PAREN, OPENING_CURLY_BRACKET, OR, PERCENT, PLUS, PLUS_EQUALS, PLUS_PLUS, RAW_STRING, RECOVER, RECURSE, RETURN, RTRIM, SEMICOLON, SEP, SETTING, SIMPLE_NESTED, SIMPLE_RECURSE, SIMPLE_RETURN, START_TAG, STATIC_TEXT_FALSE_ALARM, STATIC_TEXT_NON_WS, STATIC_TEXT_WS, STOP, STRING_LITERAL, SWITCH, TERMINATING_EXCLAM, TERMINATING_WHITESPACE, TERSE_COMMENT, TERSE_COMMENT_END, TIMES, TIMES_EQUALS, tokenImage, TRANSFORM, TRIM, TRIVIAL_FTL_HEADER, TRUE, UNIFIED_CALL, UNIFIED_CALL_END, UNKNOWN_DIRECTIVE, USING, VISIT| Constructor and Description |
|---|
FMParser(FMParserTokenManager tm)
Constructor with generated Token Manager.
|
FMParser(InputStream stream)
Constructor with InputStream.
|
FMParser(InputStream stream,
String encoding)
Constructor with InputStream and supplied encoding
|
FMParser(Reader stream)
Constructor.
|
FMParser(String template) |
FMParser(Template template,
Reader reader,
boolean strictEscapeSyntax,
boolean stripWhitespace)
Constructs a new parser object.
|
FMParser(Template template,
Reader reader,
boolean strictEscapeSyntax,
boolean stripWhitespace,
int tagSyntax) |
FMParser(Template template,
Reader reader,
boolean strictEscapeSyntax,
boolean stripWhitespace,
int tagSyntax,
int incompatibleImprovements) |
FMParser(Template template,
Reader reader,
boolean strictEscapeSyntax,
boolean stripWhitespace,
int tagSyntax,
int namingConvention,
int incompatibleImprovements) |
| Modifier and Type | Method and Description |
|---|---|
int |
_getLastNamingConvention()
Don't use it, unless you are developing FreeMarker itself.
|
int |
_getLastTagSyntax()
Don't use it, unless you are developing FreeMarker itself.
|
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() |
TemplateElement |
Assign() |
freemarker.core.AttemptBlock |
Attempt() |
Expression |
BooleanLiteral() |
freemarker.core.BreakInstruction |
Break()
Production used to break out of a loop or a switch block.
|
Expression |
BuiltIn(Expression lhoExp) |
freemarker.core.BuiltinVariable |
BuiltinVariable() |
TemplateElement |
Call() |
freemarker.core.Case |
Case() |
Comment |
Comment() |
freemarker.core.CompressedBlock |
Compress() |
static FMParser |
createExpressionParser(String s)
Create an FM expression parser using a string.
|
Expression |
DefaultTo(Expression exp) |
void |
disable_tracing()
Disable tracing.
|
Expression |
DotVariable(Expression exp)
production for when a key is specified by
|
Expression |
DynamicKey(Expression exp)
production for when the key is specified
in brackets.
|
freemarker.core.ElseOfList |
ElseOfList() |
void |
enable_tracing()
Enable tracing.
|
Expression |
EqualityExpression() |
freemarker.core.EscapeBlock |
Escape() |
Expression |
Exists(Expression exp) |
Expression |
Expression()
This is the same as OrExpression, since
the OR is the operator with the lowest
precedence.
|
freemarker.core.FallbackInstruction |
FallBack() |
TemplateElement |
Flush() |
freemarker.core.IteratorBlock |
ForEach() |
TemplateElement |
FreemarkerDirective()
A production for FreeMarker directives.
|
TemplateElement |
FreeMarkerText()
A production freemarker text that may contain
${...} and #{...} but no directives.
|
ParseException |
generateParseException()
Generate ParseException.
|
Token |
getNextToken()
Get the next Token.
|
Token |
getToken(int index)
Get the specific Token.
|
freemarker.core.HashLiteral |
HashLiteral() |
void |
HeaderElement() |
freemarker.core.Identifier |
Identifier() |
Expression |
IdentifierOrStringLiteral() |
TemplateElement |
If() |
LibraryLoad |
Import() |
freemarker.core.Include |
Include() |
freemarker.core.Items |
Items() |
TemplateElement |
List() |
freemarker.core.ListLiteral |
ListLiteral() |
Token |
LooseDirectiveEnd()
Production to terminate potentially empty elements.
|
Macro |
Macro() |
freemarker.core.MethodCall |
MethodArgs(Expression exp)
production for an arglist part of a method invocation.
|
freemarker.core.MixedContent |
MixedContent() |
Expression |
MultiplicativeExpression()
A unary expression followed by zero or more
unary expressions with operators in between.
|
HashMap |
NamedArgs() |
TemplateElement |
Nested() |
freemarker.core.NoEscapeBlock |
NoEscape() |
TextBlock |
NoParse() |
Expression |
NotExpression() |
Expression |
NumberLiteral() |
freemarker.core.NumericalOutput |
NumericalOutput() |
TemplateElement |
OptionalBlock()
A production for a block of optional content.
|
Expression |
OrExpression() |
Map |
ParamList() |
Expression |
Parenthesis() |
TextBlock |
PCData()
Production for a block of raw text
i.e.
|
ArrayList |
PositionalArgs() |
Expression |
PrimaryExpression()
Lowest level expression, a literal, a variable,
or a possibly more complex expression bounded
by parentheses.
|
Expression |
RangeExpression() |
freemarker.core.RecoveryBlock |
Recover() |
freemarker.core.RecurseNode |
Recurse() |
void |
ReInit(FMParserTokenManager tm)
Reinitialise.
|
void |
ReInit(InputStream stream)
Reinitialise.
|
void |
ReInit(InputStream stream,
String encoding)
Reinitialise.
|
void |
ReInit(Reader stream)
Reinitialise.
|
Expression |
RelationalExpression() |
ReturnInstruction |
Return()
Production used to jump out of a macro.
|
TemplateElement |
Root()
Root production to be used when parsing
an entire file.
|
freemarker.core.Sep |
Sep() |
freemarker.core.PropertySetting |
Setting() |
freemarker.core.StopInstruction |
Stop() |
freemarker.core.StringLiteral |
StringLiteral(boolean interpolate) |
freemarker.core.DollarVariable |
StringOutput()
A production representing the ${...}
that outputs a variable.
|
freemarker.core.SwitchBlock |
Switch() |
freemarker.core.TransformBlock |
Transform() |
TemplateElement |
Trim() |
Expression |
UnaryExpression()
A primary expression preceded by zero or
more unary operators.
|
Expression |
UnaryPlusMinusExpression() |
TemplateElement |
UnifiedMacroTransform() |
Token |
UnparsedContent(Token start,
StringBuffer buf)
Production for dealing with unparsed content,
i.e.
|
freemarker.core.VisitNode |
Visit() |
public FMParserTokenManager token_source
public Token token
public Token jj_nt
public FMParser(Template template, Reader reader, boolean strictEscapeSyntax, boolean stripWhitespace)
template - The template associated with this parser.reader - The character stream to use as inputstrictEscapeSyntax - Whether FreeMarker directives must start with a #public FMParser(Template template, Reader reader, boolean strictEscapeSyntax, boolean stripWhitespace, int tagSyntax)
public FMParser(Template template, Reader reader, boolean strictEscapeSyntax, boolean stripWhitespace, int tagSyntax, int incompatibleImprovements)
public FMParser(Template template, Reader reader, boolean strictEscapeSyntax, boolean stripWhitespace, int tagSyntax, int namingConvention, int incompatibleImprovements)
public FMParser(String template)
public FMParser(InputStream stream)
public FMParser(InputStream stream, String encoding)
public FMParser(Reader stream)
public FMParser(FMParserTokenManager tm)
public static FMParser createExpressionParser(String s)
public int _getLastTagSyntax()
public int _getLastNamingConvention()
public final Expression Expression() throws ParseException
ParseExceptionpublic final Expression PrimaryExpression() throws ParseException
ParseExceptionpublic final Expression Parenthesis() throws ParseException
ParseExceptionpublic final Expression UnaryExpression() throws ParseException
ParseExceptionpublic final Expression NotExpression() throws ParseException
ParseExceptionpublic final Expression UnaryPlusMinusExpression() throws ParseException
ParseExceptionpublic final Expression AdditiveExpression() throws ParseException
ParseExceptionpublic final Expression MultiplicativeExpression() throws ParseException
ParseExceptionpublic final Expression EqualityExpression() throws ParseException
ParseExceptionpublic final Expression RelationalExpression() throws ParseException
ParseExceptionpublic final Expression RangeExpression() throws ParseException
ParseExceptionpublic final Expression AndExpression() throws ParseException
ParseExceptionpublic final Expression OrExpression() throws ParseException
ParseExceptionpublic final freemarker.core.ListLiteral ListLiteral()
throws ParseException
ParseExceptionpublic final Expression NumberLiteral() throws ParseException
ParseExceptionpublic final freemarker.core.Identifier Identifier()
throws ParseException
ParseExceptionpublic final Expression IdentifierOrStringLiteral() throws ParseException
ParseExceptionpublic final freemarker.core.BuiltinVariable BuiltinVariable()
throws ParseException
ParseExceptionpublic final Expression AddSubExpression(Expression exp) throws ParseException
ParseExceptionpublic final Expression DefaultTo(Expression exp) throws ParseException
ParseExceptionpublic final Expression Exists(Expression exp) throws ParseException
ParseExceptionpublic final Expression BuiltIn(Expression lhoExp) throws ParseException
ParseExceptionpublic final Expression DotVariable(Expression exp) throws ParseException
ParseExceptionpublic final Expression DynamicKey(Expression exp) throws ParseException
ParseExceptionpublic final freemarker.core.MethodCall MethodArgs(Expression exp) throws ParseException
ParseExceptionpublic final freemarker.core.StringLiteral StringLiteral(boolean interpolate)
throws ParseException
ParseExceptionpublic final Expression BooleanLiteral() throws ParseException
ParseExceptionpublic final freemarker.core.HashLiteral HashLiteral()
throws ParseException
ParseExceptionpublic final freemarker.core.DollarVariable StringOutput()
throws ParseException
ParseExceptionpublic final freemarker.core.NumericalOutput NumericalOutput()
throws ParseException
ParseExceptionpublic final TemplateElement If() throws ParseException
ParseExceptionpublic final freemarker.core.AttemptBlock Attempt()
throws ParseException
ParseExceptionpublic final freemarker.core.RecoveryBlock Recover()
throws ParseException
ParseExceptionpublic final TemplateElement List() throws ParseException
ParseExceptionpublic final freemarker.core.ElseOfList ElseOfList()
throws ParseException
ParseExceptionpublic final freemarker.core.IteratorBlock ForEach()
throws ParseException
ParseExceptionpublic final freemarker.core.Items Items()
throws ParseException
ParseExceptionpublic final freemarker.core.Sep Sep()
throws ParseException
ParseExceptionpublic final freemarker.core.VisitNode Visit()
throws ParseException
ParseExceptionpublic final freemarker.core.RecurseNode Recurse()
throws ParseException
ParseExceptionpublic final freemarker.core.FallbackInstruction FallBack()
throws ParseException
ParseExceptionpublic final freemarker.core.BreakInstruction Break()
throws ParseException
ParseExceptionpublic final ReturnInstruction Return() throws ParseException
ParseExceptionpublic final freemarker.core.StopInstruction Stop()
throws ParseException
ParseExceptionpublic final TemplateElement Nested() throws ParseException
ParseExceptionpublic final TemplateElement Flush() throws ParseException
ParseExceptionpublic final TemplateElement Trim() throws ParseException
ParseExceptionpublic final TemplateElement Assign() throws ParseException
ParseExceptionpublic final freemarker.core.Include Include()
throws ParseException
ParseExceptionpublic final LibraryLoad Import() throws ParseException
ParseExceptionpublic final Macro Macro() throws ParseException
ParseExceptionpublic final freemarker.core.CompressedBlock Compress()
throws ParseException
ParseExceptionpublic final TemplateElement UnifiedMacroTransform() throws ParseException
ParseExceptionpublic final TemplateElement Call() throws ParseException
ParseExceptionpublic final HashMap NamedArgs() throws ParseException
ParseExceptionpublic final ArrayList PositionalArgs() throws ParseException
ParseExceptionpublic final Comment Comment() throws ParseException
ParseExceptionpublic final TextBlock NoParse() throws ParseException
ParseExceptionpublic final freemarker.core.TransformBlock Transform()
throws ParseException
ParseExceptionpublic final freemarker.core.SwitchBlock Switch()
throws ParseException
ParseExceptionpublic final freemarker.core.Case Case()
throws ParseException
ParseExceptionpublic final freemarker.core.EscapeBlock Escape()
throws ParseException
ParseExceptionpublic final freemarker.core.NoEscapeBlock NoEscape()
throws ParseException
ParseExceptionpublic final Token LooseDirectiveEnd() throws ParseException
ParseExceptionpublic final freemarker.core.PropertySetting Setting()
throws ParseException
ParseExceptionpublic final TemplateElement FreemarkerDirective() throws ParseException
ParseExceptionpublic final TextBlock PCData() throws ParseException
ParseExceptionpublic final Token UnparsedContent(Token start, StringBuffer buf) throws ParseException
ParseExceptionpublic final freemarker.core.MixedContent MixedContent()
throws ParseException
ParseExceptionpublic final TemplateElement FreeMarkerText() throws ParseException
ParseExceptionpublic final TemplateElement OptionalBlock() throws ParseException
ParseExceptionpublic final void HeaderElement()
throws ParseException
ParseExceptionpublic final Map ParamList() throws ParseException
ParseExceptionpublic final TemplateElement Root() throws ParseException
ParseExceptionpublic void ReInit(InputStream stream)
public void ReInit(InputStream stream, String encoding)
public void ReInit(Reader stream)
public void ReInit(FMParserTokenManager tm)
public final Token getNextToken()
public final Token getToken(int index)
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()
Copyright © 2016. All Rights Reserved.