freemarker.core
public class FMParser extends Object
Modifier and Type | Field and Description |
---|---|
static int |
_INCLUDE
RegularExpression Id.
|
static int |
AND
RegularExpression Id.
|
static int |
AS
RegularExpression Id.
|
static int |
ASSIGN
RegularExpression Id.
|
static int |
ATTEMPT
RegularExpression Id.
|
static int |
BLANK
RegularExpression Id.
|
static int |
BREAK
RegularExpression Id.
|
static int |
BUILT_IN
RegularExpression Id.
|
static int |
CALL
RegularExpression Id.
|
static int |
CASE
RegularExpression Id.
|
static int |
CLOSE_BRACE
RegularExpression Id.
|
static int |
CLOSE_BRACKET
RegularExpression Id.
|
static int |
CLOSE_PAREN
RegularExpression Id.
|
static int |
CLOSE_TAG1
RegularExpression Id.
|
static int |
CLOSE_TAG2
RegularExpression Id.
|
static int |
COLON
RegularExpression Id.
|
static int |
COMMA
RegularExpression Id.
|
static int |
COMMENT
RegularExpression Id.
|
static int |
COMPRESS
RegularExpression Id.
|
static int |
DECIMAL
RegularExpression Id.
|
static int |
DEFAUL
RegularExpression Id.
|
static int |
DEFAULT
Lexical state.
|
static int |
DIGIT
RegularExpression Id.
|
static int |
DIRECTIVE_END
RegularExpression Id.
|
static int |
DIVIDE
RegularExpression Id.
|
static int |
DOT
RegularExpression Id.
|
static int |
DOT_DOT
RegularExpression Id.
|
static int |
DOUBLE_EQUALS
RegularExpression Id.
|
static int |
DOUBLE_STAR
RegularExpression Id.
|
static int |
ELLIPSIS
RegularExpression Id.
|
static int |
ELSE
RegularExpression Id.
|
static int |
ELSE_IF
RegularExpression Id.
|
static int |
EMPTY_DIRECTIVE_END
RegularExpression Id.
|
static int |
END_ASSIGN
RegularExpression Id.
|
static int |
END_ATTEMPT
RegularExpression Id.
|
static int |
END_COMPRESS
RegularExpression Id.
|
static int |
END_ESCAPE
RegularExpression Id.
|
static int |
END_FOREACH
RegularExpression Id.
|
static int |
END_FUNCTION
RegularExpression Id.
|
static int |
END_GLOBAL
RegularExpression Id.
|
static int |
END_IF
RegularExpression Id.
|
static int |
END_LIST
RegularExpression Id.
|
static int |
END_LOCAL
RegularExpression Id.
|
static int |
END_MACRO
RegularExpression Id.
|
static int |
END_NOESCAPE
RegularExpression Id.
|
static int |
END_RECOVER
RegularExpression Id.
|
static int |
END_SWITCH
RegularExpression Id.
|
static int |
END_TAG
RegularExpression Id.
|
static int |
END_TRANSFORM
RegularExpression Id.
|
static int |
EOF
End of File.
|
static int |
EQUALS
RegularExpression Id.
|
static int |
ESCAPE
RegularExpression Id.
|
static int |
ESCAPED_CHAR
RegularExpression Id.
|
static int |
ESCAPED_GT
RegularExpression Id.
|
static int |
ESCAPED_GTE
RegularExpression Id.
|
static int |
EXCLAM
RegularExpression Id.
|
static int |
EXISTS
RegularExpression Id.
|
static int |
EXPRESSION_COMMENT
Lexical state.
|
static int |
FALLBACK
RegularExpression Id.
|
static int |
FALSE
RegularExpression Id.
|
static int |
FALSE_ALERT
RegularExpression Id.
|
static int |
FLUSH
RegularExpression Id.
|
static int |
FM_EXPRESSION
Lexical state.
|
static int |
FOREACH
RegularExpression Id.
|
static int |
FTL_HEADER
RegularExpression Id.
|
static int |
FUNCTION
RegularExpression Id.
|
static int |
GLOBALASSIGN
RegularExpression Id.
|
static int |
HALT
RegularExpression Id.
|
static int |
ID
RegularExpression Id.
|
static int |
IF
RegularExpression Id.
|
static int |
IMPORT
RegularExpression Id.
|
static int |
IN
RegularExpression Id.
|
static int |
IN_PAREN
Lexical state.
|
static int |
INTEGER
RegularExpression Id.
|
freemarker.core.Token |
jj_nt
Next token.
|
static int |
KEEP_GOING
RegularExpression Id.
|
static int |
LESS_THAN
RegularExpression Id.
|
static int |
LESS_THAN_EQUALS
RegularExpression Id.
|
static int |
LETTER
RegularExpression Id.
|
static int |
LIST
RegularExpression Id.
|
static int |
LOCALASSIGN
RegularExpression Id.
|
static int |
LONE_LESS_THAN_OR_DASH
RegularExpression Id.
|
static int |
LTRIM
RegularExpression Id.
|
static int |
MACRO
RegularExpression Id.
|
static int |
MAYBE_END
RegularExpression Id.
|
static int |
MINUS
RegularExpression Id.
|
static int |
NAMED_PARAMETER_EXPRESSION
Lexical state.
|
static int |
NATURAL_GT
RegularExpression Id.
|
static int |
NATURAL_GTE
RegularExpression Id.
|
static int |
NESTED
RegularExpression Id.
|
static int |
NO_PARSE
Lexical state.
|
static int |
NO_SPACE_EXPRESSION
Lexical state.
|
static int |
NODIRECTIVE
Lexical state.
|
static int |
NOESCAPE
RegularExpression Id.
|
static int |
NOPARSE
RegularExpression Id.
|
static int |
NOT_EQUALS
RegularExpression Id.
|
static int |
NOTRIM
RegularExpression Id.
|
static int |
NUMERICAL_ESCAPE
RegularExpression Id.
|
static int |
OPEN_BRACE
RegularExpression Id.
|
static int |
OPEN_BRACKET
RegularExpression Id.
|
static int |
OPEN_PAREN
RegularExpression Id.
|
static int |
OR
RegularExpression Id.
|
static int |
OUTPUT_ESCAPE
RegularExpression Id.
|
static int |
PERCENT
RegularExpression Id.
|
static int |
PLUS
RegularExpression Id.
|
static int |
PRINTABLE_CHARS
RegularExpression Id.
|
static int |
RAW_STRING
RegularExpression Id.
|
static int |
RECOVER
RegularExpression Id.
|
static int |
RECURSE
RegularExpression Id.
|
static int |
RETURN
RegularExpression Id.
|
static int |
RTRIM
RegularExpression Id.
|
static int |
SEMICOLON
RegularExpression Id.
|
static int |
SETTING
RegularExpression Id.
|
static int |
SIMPLE_NESTED
RegularExpression Id.
|
static int |
SIMPLE_RECURSE
RegularExpression Id.
|
static int |
SIMPLE_RETURN
RegularExpression Id.
|
static int |
START_TAG
RegularExpression Id.
|
static int |
STOP
RegularExpression Id.
|
static int |
STRING_LITERAL
RegularExpression Id.
|
static int |
SWITCH
RegularExpression Id.
|
static int |
TERMINATING_EXCLAM
RegularExpression Id.
|
static int |
TERMINATING_WHITESPACE
RegularExpression Id.
|
static int |
TERSE_COMMENT
RegularExpression Id.
|
static int |
TERSE_COMMENT_END
RegularExpression Id.
|
static int |
TIMES
RegularExpression Id.
|
freemarker.core.Token |
token
Current token.
|
freemarker.core.FMParserTokenManager |
token_source
Generated Token Manager.
|
static String[] |
tokenImage
Literal token values.
|
static int |
TRANSFORM
RegularExpression Id.
|
static int |
TRIM
RegularExpression Id.
|
static int |
TRIVIAL_FTL_HEADER
RegularExpression Id.
|
static int |
TRUE
RegularExpression Id.
|
static int |
UNIFIED_CALL
RegularExpression Id.
|
static int |
UNIFIED_CALL_END
RegularExpression Id.
|
static int |
UNKNOWN_DIRECTIVE
RegularExpression Id.
|
static int |
USING
RegularExpression Id.
|
static int |
VISIT
RegularExpression Id.
|
static int |
WHITESPACE
RegularExpression Id.
|
Constructor and Description |
---|
FMParser(freemarker.core.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) |
Modifier and Type | Method and Description |
---|---|
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 exp) |
freemarker.core.BuiltinVariable |
BuiltinVariable() |
TemplateElement |
Call() |
freemarker.core.Case |
Case() |
Comment |
Comment() |
freemarker.core.CompressedBlock |
Compress() |
TemplateElement |
Content() |
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.
|
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.
|
freemarker.core.Token |
getNextToken()
Get the next Token.
|
freemarker.core.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.IteratorBlock |
List() |
freemarker.core.ListLiteral |
ListLiteral() |
freemarker.core.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.
|
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(freemarker.core.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.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() |
freemarker.core.Token |
UnparsedContent(StringBuffer buf)
Production for dealing with unparsed content,
i.e.
|
freemarker.core.VisitNode |
Visit() |
public freemarker.core.FMParserTokenManager token_source
public freemarker.core.Token token
public freemarker.core.Token jj_nt
public static final int EOF
public static final int BLANK
public static final int START_TAG
public static final int END_TAG
public static final int CLOSE_TAG1
public static final int CLOSE_TAG2
public static final int ATTEMPT
public static final int RECOVER
public static final int IF
public static final int ELSE_IF
public static final int LIST
public static final int FOREACH
public static final int SWITCH
public static final int CASE
public static final int ASSIGN
public static final int GLOBALASSIGN
public static final int LOCALASSIGN
public static final int _INCLUDE
public static final int IMPORT
public static final int FUNCTION
public static final int MACRO
public static final int TRANSFORM
public static final int VISIT
public static final int STOP
public static final int RETURN
public static final int CALL
public static final int SETTING
public static final int COMPRESS
public static final int COMMENT
public static final int TERSE_COMMENT
public static final int NOPARSE
public static final int END_IF
public static final int END_LIST
public static final int END_RECOVER
public static final int END_ATTEMPT
public static final int END_FOREACH
public static final int END_LOCAL
public static final int END_GLOBAL
public static final int END_ASSIGN
public static final int END_FUNCTION
public static final int END_MACRO
public static final int END_COMPRESS
public static final int END_TRANSFORM
public static final int END_SWITCH
public static final int ELSE
public static final int BREAK
public static final int SIMPLE_RETURN
public static final int HALT
public static final int FLUSH
public static final int TRIM
public static final int LTRIM
public static final int RTRIM
public static final int NOTRIM
public static final int DEFAUL
public static final int SIMPLE_NESTED
public static final int NESTED
public static final int SIMPLE_RECURSE
public static final int RECURSE
public static final int FALLBACK
public static final int ESCAPE
public static final int END_ESCAPE
public static final int NOESCAPE
public static final int END_NOESCAPE
public static final int UNIFIED_CALL
public static final int UNIFIED_CALL_END
public static final int FTL_HEADER
public static final int TRIVIAL_FTL_HEADER
public static final int UNKNOWN_DIRECTIVE
public static final int WHITESPACE
public static final int PRINTABLE_CHARS
public static final int FALSE_ALERT
public static final int OUTPUT_ESCAPE
public static final int NUMERICAL_ESCAPE
public static final int ESCAPED_CHAR
public static final int STRING_LITERAL
public static final int RAW_STRING
public static final int FALSE
public static final int TRUE
public static final int INTEGER
public static final int DECIMAL
public static final int DOT
public static final int DOT_DOT
public static final int BUILT_IN
public static final int EXISTS
public static final int EQUALS
public static final int DOUBLE_EQUALS
public static final int NOT_EQUALS
public static final int LESS_THAN
public static final int LESS_THAN_EQUALS
public static final int ESCAPED_GT
public static final int ESCAPED_GTE
public static final int PLUS
public static final int MINUS
public static final int TIMES
public static final int DOUBLE_STAR
public static final int ELLIPSIS
public static final int DIVIDE
public static final int PERCENT
public static final int AND
public static final int OR
public static final int EXCLAM
public static final int COMMA
public static final int SEMICOLON
public static final int COLON
public static final int OPEN_BRACKET
public static final int CLOSE_BRACKET
public static final int OPEN_PAREN
public static final int CLOSE_PAREN
public static final int OPEN_BRACE
public static final int CLOSE_BRACE
public static final int IN
public static final int AS
public static final int USING
public static final int ID
public static final int LETTER
public static final int DIGIT
public static final int DIRECTIVE_END
public static final int EMPTY_DIRECTIVE_END
public static final int NATURAL_GT
public static final int NATURAL_GTE
public static final int TERMINATING_WHITESPACE
public static final int TERMINATING_EXCLAM
public static final int TERSE_COMMENT_END
public static final int MAYBE_END
public static final int KEEP_GOING
public static final int LONE_LESS_THAN_OR_DASH
public static final int DEFAULT
public static final int NODIRECTIVE
public static final int FM_EXPRESSION
public static final int IN_PAREN
public static final int NAMED_PARAMETER_EXPRESSION
public static final int EXPRESSION_COMMENT
public static final int NO_SPACE_EXPRESSION
public static final int NO_PARSE
public static final String[] tokenImage
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(String template)
public FMParser(InputStream stream)
public FMParser(InputStream stream, String encoding)
public FMParser(Reader stream)
public FMParser(freemarker.core.FMParserTokenManager tm)
public static FMParser createExpressionParser(String s)
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 exp) 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 freemarker.core.IteratorBlock List() throws ParseException
ParseException
public final freemarker.core.IteratorBlock ForEach() 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 freemarker.core.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 freemarker.core.Token UnparsedContent(StringBuffer buf) throws ParseException
ParseException
public final TemplateElement Content() 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(freemarker.core.FMParserTokenManager tm)
public final freemarker.core.Token getNextToken()
public final freemarker.core.Token getToken(int index)
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()