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
ParseException
public final Expression PrimaryExpression() throws ParseException
ParseException
public final Expression Parenthesis() throws ParseException
ParseException
public final Expression UnaryExpression() throws ParseException
ParseException
public final Expression NotExpression() throws ParseException
ParseException
public final Expression UnaryPlusMinusExpression() throws ParseException
ParseException
public final Expression AdditiveExpression() throws ParseException
ParseException
public final Expression MultiplicativeExpression() throws ParseException
ParseException
public final Expression EqualityExpression() throws ParseException
ParseException
public final Expression RelationalExpression() throws ParseException
ParseException
public final Expression RangeExpression() throws ParseException
ParseException
public final Expression AndExpression() throws ParseException
ParseException
public final Expression OrExpression() throws ParseException
ParseException
public final freemarker.core.ListLiteral ListLiteral() throws ParseException
ParseException
public final Expression NumberLiteral() throws ParseException
ParseException
public final freemarker.core.Identifier Identifier() throws ParseException
ParseException
public final Expression IdentifierOrStringLiteral() throws ParseException
ParseException
public final freemarker.core.BuiltinVariable BuiltinVariable() throws ParseException
ParseException
public final Expression AddSubExpression(Expression exp) throws ParseException
ParseException
public final Expression DefaultTo(Expression exp) throws ParseException
ParseException
public final Expression Exists(Expression exp) throws ParseException
ParseException
public final Expression BuiltIn(Expression lhoExp) throws ParseException
ParseException
public final Expression DotVariable(Expression exp) throws ParseException
ParseException
public final Expression DynamicKey(Expression exp) throws ParseException
ParseException
public final freemarker.core.MethodCall MethodArgs(Expression exp) throws ParseException
ParseException
public final freemarker.core.StringLiteral StringLiteral(boolean interpolate) throws ParseException
ParseException
public final Expression BooleanLiteral() throws ParseException
ParseException
public final freemarker.core.HashLiteral HashLiteral() throws ParseException
ParseException
public final freemarker.core.DollarVariable StringOutput() throws ParseException
ParseException
public final freemarker.core.NumericalOutput NumericalOutput() throws ParseException
ParseException
public final TemplateElement If() throws ParseException
ParseException
public final freemarker.core.AttemptBlock Attempt() throws ParseException
ParseException
public final freemarker.core.RecoveryBlock Recover() throws ParseException
ParseException
public final TemplateElement List() throws ParseException
ParseException
public final freemarker.core.ElseOfList ElseOfList() throws ParseException
ParseException
public final freemarker.core.IteratorBlock ForEach() throws ParseException
ParseException
public final freemarker.core.Items Items() throws ParseException
ParseException
public final freemarker.core.Sep Sep() throws ParseException
ParseException
public final freemarker.core.VisitNode Visit() throws ParseException
ParseException
public final freemarker.core.RecurseNode Recurse() throws ParseException
ParseException
public final freemarker.core.FallbackInstruction FallBack() throws ParseException
ParseException
public final freemarker.core.BreakInstruction Break() throws ParseException
ParseException
public final ReturnInstruction Return() throws ParseException
ParseException
public final freemarker.core.StopInstruction Stop() throws ParseException
ParseException
public final TemplateElement Nested() throws ParseException
ParseException
public final TemplateElement Flush() throws ParseException
ParseException
public final TemplateElement Trim() throws ParseException
ParseException
public final TemplateElement Assign() throws ParseException
ParseException
public final freemarker.core.Include Include() throws ParseException
ParseException
public final LibraryLoad Import() throws ParseException
ParseException
public final Macro Macro() throws ParseException
ParseException
public final freemarker.core.CompressedBlock Compress() throws ParseException
ParseException
public final TemplateElement UnifiedMacroTransform() throws ParseException
ParseException
public final TemplateElement Call() throws ParseException
ParseException
public final HashMap NamedArgs() throws ParseException
ParseException
public final ArrayList PositionalArgs() throws ParseException
ParseException
public final Comment Comment() throws ParseException
ParseException
public final TextBlock NoParse() throws ParseException
ParseException
public final freemarker.core.TransformBlock Transform() throws ParseException
ParseException
public final freemarker.core.SwitchBlock Switch() throws ParseException
ParseException
public final freemarker.core.Case Case() throws ParseException
ParseException
public final freemarker.core.EscapeBlock Escape() throws ParseException
ParseException
public final freemarker.core.NoEscapeBlock NoEscape() throws ParseException
ParseException
public final Token LooseDirectiveEnd() throws ParseException
ParseException
public final freemarker.core.PropertySetting Setting() throws ParseException
ParseException
public final TemplateElement FreemarkerDirective() throws ParseException
ParseException
public final TextBlock PCData() throws ParseException
ParseException
public final Token UnparsedContent(Token start, StringBuffer buf) throws ParseException
ParseException
public final freemarker.core.MixedContent MixedContent() throws ParseException
ParseException
public final TemplateElement FreeMarkerText() throws ParseException
ParseException
public final TemplateElement OptionalBlock() throws ParseException
ParseException
public final void HeaderElement() throws ParseException
ParseException
public final Map ParamList() throws ParseException
ParseException
public final TemplateElement Root() throws ParseException
ParseException
public 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.