public class SoyFileParser extends Object
Important: Do not use outside of Soy code (treat as superpackage-private).
This parser parses the following Soy file structure:
1. Delegate package (delpackage):
+ Optional.
+ The file must contain 0 or 1 delpackage declaration.
+ It must appear before the namespace declaration.
+ It must appear on its own line and start at the start of a line.
Example: {delpackage MySecretFeature}
2. Namespace:
+ The file must contain exactly one namespace declaration.
+ It must appear before any templates.
+ It must appear on its own line and start at the start of a line.
Example:
{namespace boo.foo}
3. Alias:
+ Alias declarations must appear after the namespace declaration.
+ They must appear before any templates.
+ Each must appear on its own line and start at the start of a line.
Examples:
{alias boo.foo.goo.moo}
{alias boo.foo.goo.moo as zoo}
4. SoyDoc:
+ Starts with slash-star-star (/**) and ends with star-slash (*/) like JavaDoc.
+ SoyDoc must appear on its own line(s) and start at the start of a line.
+ Currently recognizes two tags: "@param keyName" and "@param? optionalKeyName".
Example:
/**
* @param boo Something scary.
* @param? goo Something slimy (optional).
*/
5. Template:
+ Each template must be immediately preceded by a SoyDoc block.
+ The {template} tag and the {/template} tag must each appear on its own line(s) and start
at the start of a line.
Examples:
/**
* @param boo Something scary.
* @param? goo Something slimy (optional).
*/
{template .foo autoescape="..."}
{msg desc=""}
{$boo} has a friend named {$goo.firstName}.
{/msg}
{/template}
6. Misc:
+ Other than the items specified above, everything else is ignored.
+ SoyDoc blocks not immediately followed by a template are ignored.
+ The file must end with a newline.
Template contents are parsed as follows:
Header:
1. Comments:
+ Standard "//" for a rest-of-line comment. Must appear at start of line or after a space.
+ Standard slash-star (/*) ... star-slash (*/) for a block comment.
+ Doc comments are not allowed, except when attached to a valid declaration.
2. Param declaration:
+ Soy tag with command name "@param" and command text "key: type".
+ Optional desc string is written as a block doc comment, which either must
precede the param tag, or must start on the same line as the end of the '@param' tag.
Examples:
/** A list of numbers. */
/**
A list of numbers. */
3. Injected param declaration:
+ Works exactly like @param except that parameter values are taken from the
implicit $ij scope.
+ Soy tag with command name "@inject" and command text "key: type".
+ Optional desc string is written as a block doc comment, which either must
precede the param tag, or must start on the same line as the end of the '@inject' tag.
Examples:
/** A list of numbers. */
/**
A list of numbers. */
Body:
1. Soy tag format:
+ Can be delimited by single braces "{...}".
+ } characters are only allowed in tags if they're inside string literals.
+ Some Soy tags are allowed to end in "/}" to denote immediate ending of a block.
+ It is an error to use "/}" when it's not applicable to the command.
+ If there is a command name, it must come immediately after the opening delimiter.
+ The command name must be followed by either the closing delimiter (if the command does not
take any command text) or a whitespace (if the command takes command text).
Examples:
{print $boo} // explicit 'print' command
{$boo.foo} // implicit 'print' command
{printer} // implicit 'print' command (the prefix 'print' here is not a command name)
{\n} // a command that doesn't take any command text
{call .gooMoo data="all" /} // self-ending block
{call .gooMoo data="all"}...{/call} // block with separate start and end tags
2. Raw text:
+ Raw text is fixed text that will be part of the template output. There are 3 types.
+ Any text outside of Soy tags is raw text.
+ There are 7 special character commands that produce raw text strings:
{sp} = space {nil} = empty string {\n} = newline (line feed) {\r} = carriage return
{\t} = tab {lb} = left brace {rb} = right brace
+ A section of raw text (may contain braces) can be enclosed within a 'literal' block:
{literal}...{/literal}
3. Msg blocks:
+ A block between {msg} and {/msg} tags represents a message for translation.
+ It is an error to nest {msg} blocks.
+ Within a {msg} block, the parsing of Soy tags is the same. The only difference is that we
also recognize "<" and ">" as opening and closing an HTML tag. This is because each
HTML tag as a whole needs to be turned into a single placeholder in the message.
+ A {msg} block may have a {plural} or {select} block as its only content.
+ A {msg} block may be followed by one optional additional {fallbackmsg} block.
Example:
{msg desc="Event title."}
Join event <a href="{$event.url}">{$event.title}</a>.
{fallbackmsg desc="Event title."}
Join event {$event.title}.
{/msg}
4. Other Soy commands:
{print ...}
{...} // implied 'print' command
{xid ...}
{css ...}
{let ... /}
{let ...}...{/let}
{if ...}...{elseif ...}...{else ...}...{/if}
{switch ...}{case ...}...{default}...{/switch}
{foreach ...}...{ifempty}...{/foreach}
{for ...}...{/for}
{call ... /}
{delcall ... /}
{call ...}{param ... /}{param ...}...{/param}{/call}
{delcall ...}{param ... /}{param ...}...{/param}{/delcall}
{log}...{/log}
{debugger}
{velog ...}....{/velog}
5. Misc:
+ The following commands are not allowed to appear in a template:
{alias ...} {namespace ...} {delpackage ...} {template ...} {deltemplate ...}
Expressions:
A. Variable:
+ A dollar sign "$" followed by an identifier (no space between).
B. Data reference:
+ The first part must be "$" followed by the first key name (no space between).
+ The first key name cannot be a number.
+ A variable will only have the first part. A data reference may have subsequent parts.
+ Subsequent parts may be:
- A dot "." or question-dot "?." followed by a key name or array index (spaces between are
allowed).
- Brackets "[ ]" or question-brackets "?[ ]" with any expression inside the brackets (see
below for definition of expression).
+ A special case is when the first key name is "ij". In this case, it's a reference to
injected data, and the reference is considered to start from the second key (i.e. the second
key actually becomes the first key in the parsed node).
Examples: $aaa $ij.aaa $aaa.bbb.0.ccc.12 $aaa[0]['bbb'].ccc $aaa[$bbb + $ccc]
C. Global:
+ One or more identifiers. If more than one, a dot "." is used to separate them.
+ Must not be preceded by a dollar sign "$".
Examples: AAA aaa.bbb.CCC a22.b88_
D. Expression list:
+ A comma-separated list of one or more expressions (see below for definition of expression).
Examples: $aaa, $bbb.ccc + 1, round(3.14)
E. Named parameter list:
+ A named parameter list, used only for proto initialization calls.
+ A comma-separate list of named expressions, in which names and expressions are separated by
a colon ":".
+ Named and unnamed expressions cannot be mixed within the same function call.
Examples: foo: $aaa, bar: $bbb.ccc + 1, baz: round(3.14)
F. Expression:
1. Data reference:
+ See above for definition.
2. Global:
+ See above for definition.
3. Null: null
4. Boolean: false true
5. Integer:
+ No octal numbers.
+ Hex numbers have strict lower case "x" in "0x" and "A-F" or "a-f".
Examples: 0 26 -729 0x1a2B
6. Float:
+ Decimal numbers only.
+ Must have digits on both sides of decimal point.
+ Exponents have strict lower case "e".
Examples: 0.0 3.14159 -20.0 6.03e23 -3e-3
7. String:
+ Single quotes only.
+ Escape sequences: \\ \' \" \n \r \t \b \f
+ Unicode escape: \ u #### (backslash, "u", four hex digits -- no spaces in between)
Examples: '' 'abc' 'blah bleh bluh' 'aa\\bb\'cc\ndd' '☺'
8. List literal:
+ Delimited by brackets.
Examples: [] ['blah', 123, $foo]
9. Legacy object map literal:
+ Delimited by brackets.
+ Empty map has a single colon within the brackets (to distinguish from empty list).
+ Keys must be strings (or expressions that will evaluate to strings).
Examples: [:] ['aaa': 'blah', 'bbb': 123, $boo: $foo]
10. Operator:
+ Parentheses can be used to override precedence rules: ( )
+ Precedence 8: - (unary) not
+ Precedence 7: * / %
+ Precedence 6: + - (binary)
+ Precedence 5: < > <= >=
+ Precedence 4: == !=
+ Precedence 3: and
+ Precedence 2: or
+ Precedence 1: ?: (binary) ? : (ternary)
11. Function:
+ Function name, open parenthesis, optional expression list, close parenthesis.
+ The function name is one or more identifiers, seperated by dots.
+ See above for the definition of an expression list.
Examples: foo() isFirst($item) my.new.Proto(a: 'str', b: $foo)
12. Proto initialization:
+ Fully qualified proto name, open parenthesis, optional named parameter list,
close parenthesis.
+ See above for the definition of a named parameter list.
Examples: proto() my.new.Proto(a: 'str', b: $foo)*
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIAS_OPEN
RegularExpression Id.
|
static int |
AND
RegularExpression Id.
|
static int |
CMD_BEGIN_CALL
RegularExpression Id.
|
static int |
CMD_BEGIN_CASE
RegularExpression Id.
|
static int |
CMD_BEGIN_CSS
RegularExpression Id.
|
static int |
CMD_BEGIN_DELCALL
RegularExpression Id.
|
static int |
CMD_BEGIN_ELSEIF
RegularExpression Id.
|
static int |
CMD_BEGIN_FALLBACK_MSG
RegularExpression Id.
|
static int |
CMD_BEGIN_FOR
RegularExpression Id.
|
static int |
CMD_BEGIN_FOREACH
RegularExpression Id.
|
static int |
CMD_BEGIN_IF
RegularExpression Id.
|
static int |
CMD_BEGIN_IMPLICIT_PRINT
RegularExpression Id.
|
static int |
CMD_BEGIN_LET
RegularExpression Id.
|
static int |
CMD_BEGIN_MSG
RegularExpression Id.
|
static int |
CMD_BEGIN_PARAM
RegularExpression Id.
|
static int |
CMD_BEGIN_PLURAL
RegularExpression Id.
|
static int |
CMD_BEGIN_PRINT
RegularExpression Id.
|
static int |
CMD_BEGIN_SELECT
RegularExpression Id.
|
static int |
CMD_BEGIN_SWITCH
RegularExpression Id.
|
static int |
CMD_BEGIN_VELOG
RegularExpression Id.
|
static int |
CMD_BEGIN_XID
RegularExpression Id.
|
static int |
CMD_CLOSE_CALL
RegularExpression Id.
|
static int |
CMD_CLOSE_DELCALL
RegularExpression Id.
|
static int |
CMD_CLOSE_DELTEMPLATE
RegularExpression Id.
|
static int |
CMD_CLOSE_FOR
RegularExpression Id.
|
static int |
CMD_CLOSE_FOREACH
RegularExpression Id.
|
static int |
CMD_CLOSE_IF
RegularExpression Id.
|
static int |
CMD_CLOSE_LET
RegularExpression Id.
|
static int |
CMD_CLOSE_LOG
RegularExpression Id.
|
static int |
CMD_CLOSE_MSG
RegularExpression Id.
|
static int |
CMD_CLOSE_PARAM
RegularExpression Id.
|
static int |
CMD_CLOSE_PLURAL
RegularExpression Id.
|
static int |
CMD_CLOSE_SELECT
RegularExpression Id.
|
static int |
CMD_CLOSE_SWITCH
RegularExpression Id.
|
static int |
CMD_CLOSE_TEMPLATE
RegularExpression Id.
|
static int |
CMD_CLOSE_VELOG
RegularExpression Id.
|
static int |
CMD_COLON
RegularExpression Id.
|
static int |
CMD_DOT
RegularExpression Id.
|
static int |
CMD_DOUBLE_QUOTE
RegularExpression Id.
|
static int |
CMD_END
RegularExpression Id.
|
static int |
CMD_EQ
RegularExpression Id.
|
static int |
CMD_FULL_CR
RegularExpression Id.
|
static int |
CMD_FULL_DEBUGGER
RegularExpression Id.
|
static int |
CMD_FULL_DEFAULT
RegularExpression Id.
|
static int |
CMD_FULL_ELSE
RegularExpression Id.
|
static int |
CMD_FULL_IFEMPTY
RegularExpression Id.
|
static int |
CMD_FULL_LB
RegularExpression Id.
|
static int |
CMD_FULL_LF
RegularExpression Id.
|
static int |
CMD_FULL_NIL
RegularExpression Id.
|
static int |
CMD_FULL_RB
RegularExpression Id.
|
static int |
CMD_FULL_SP
RegularExpression Id.
|
static int |
CMD_FULL_TAB
RegularExpression Id.
|
static int |
CMD_OPEN_LITERAL
RegularExpression Id.
|
static int |
CMD_OPEN_LOG
RegularExpression Id.
|
static int |
CMD_SELF_CLOSE
RegularExpression Id.
|
static int |
CMD_SINGLE_QUOTE
RegularExpression Id.
|
static int |
COLON
RegularExpression Id.
|
static int |
COMMA
RegularExpression Id.
|
static int |
DATA_ATTR_DQ
RegularExpression Id.
|
static int |
DATA_ATTR_SQ
RegularExpression Id.
|
static int |
DEC_DIGITS
RegularExpression Id.
|
static int |
DEC_INTEGER
RegularExpression Id.
|
static int |
DECL_BEGIN_INJECT_PARAM
RegularExpression Id.
|
static int |
DECL_BEGIN_OPT_INJECT_PARAM
RegularExpression Id.
|
static int |
DECL_BEGIN_OPT_PARAM
RegularExpression Id.
|
static int |
DECL_BEGIN_PARAM
RegularExpression Id.
|
static int |
DEFAULT
Lexical state.
|
static int |
DELPACKAGE_OPEN
RegularExpression Id.
|
static int |
DELTEMPLATE_OPEN
RegularExpression Id.
|
static int |
DIV
RegularExpression Id.
|
static int |
DOLLAR_IDENT
RegularExpression Id.
|
static int |
DOT
RegularExpression Id.
|
static int |
DOUBLE_QUOTE
RegularExpression Id.
|
static int |
DQ_ATTRIBUTE_VALUE
RegularExpression Id.
|
static int |
DQ_STRING
RegularExpression Id.
|
static int |
END_DQ_EXPR_ATTR
RegularExpression Id.
|
static int |
END_SQ_EXPR_ATTR
RegularExpression Id.
|
static int |
EOF
End of File.
|
static int |
EQ
RegularExpression Id.
|
static int |
EQ_DOUBLE_QUOTE
RegularExpression Id.
|
static int |
EQ_SINGLE_QUOTE
RegularExpression Id.
|
static int |
EXPR
Lexical state.
|
static int |
EXPR_NO_DOUBLE_QUOTE
Lexical state.
|
static int |
EXPR_NO_SINGLE_QUOTE
Lexical state.
|
static int |
FALSE
RegularExpression Id.
|
static int |
FLOAT
RegularExpression Id.
|
static int |
GENDERS_ATTR_DQ
RegularExpression Id.
|
static int |
GENDERS_ATTR_SQ
RegularExpression Id.
|
static int |
GT_EQ
RegularExpression Id.
|
static int |
HEX_DIGIT
RegularExpression Id.
|
static int |
HEX_INTEGER
RegularExpression Id.
|
static int |
IDENT
RegularExpression Id.
|
static int |
IJ
RegularExpression Id.
|
static int |
IN_CMD_TAG
Lexical state.
|
static int |
IN_DQ_ATTRIBUTE_VALUE
Lexical state.
|
static int |
IN_DQ_STRING
Lexical state.
|
static int |
IN_LITERAL_BLOCK
Lexical state.
|
static int |
IN_MULTILINE_COMMENT
Lexical state.
|
static int |
IN_SOYDOC
Lexical state.
|
static int |
IN_SQ_ATTRIBUTE_VALUE
Lexical state.
|
static int |
IN_SQ_STRING
Lexical state.
|
com.google.template.soy.soyparse.Token |
jj_nt
Next token.
|
static int |
LANGLE
RegularExpression Id.
|
static int |
LBRACKET
RegularExpression Id.
|
static int |
LEGACY_AND
RegularExpression Id.
|
static int |
LEGACY_NOT
RegularExpression Id.
|
static int |
LEGACY_OR
RegularExpression Id.
|
static int |
LINE_COMMENT
RegularExpression Id.
|
static int |
LITERAL_RAW_TEXT_CONTENT
RegularExpression Id.
|
static int |
LOGONLY_ATTR_DQ
RegularExpression Id.
|
static int |
LOGONLY_ATTR_SQ
RegularExpression Id.
|
static int |
LPAREN
RegularExpression Id.
|
static int |
LT_EQ
RegularExpression Id.
|
static int |
MINUS
RegularExpression Id.
|
static int |
MOD
RegularExpression Id.
|
static int |
NAME
RegularExpression Id.
|
static int |
NAMESPACE_OPEN
RegularExpression Id.
|
static int |
NOT
RegularExpression Id.
|
static int |
NOT_EQ
RegularExpression Id.
|
static int |
NOT_WS
RegularExpression Id.
|
static int |
NULL
RegularExpression Id.
|
static int |
OR
RegularExpression Id.
|
static int |
PLUS
RegularExpression Id.
|
static int |
QCOLON
RegularExpression Id.
|
static int |
QDOT
RegularExpression Id.
|
static int |
QLBRACKET
RegularExpression Id.
|
static int |
QMARK
RegularExpression Id.
|
static int |
RANGLE
RegularExpression Id.
|
static int |
RAW_IDENT
RegularExpression Id.
|
static int |
RBRACKET
RegularExpression Id.
|
static int |
RPAREN
RegularExpression Id.
|
static int |
SINGLE_QUOTE
RegularExpression Id.
|
static int |
SOYDOC
RegularExpression Id.
|
static int |
SQ_ATTRIBUTE_VALUE
RegularExpression Id.
|
static int |
SQ_STRING
RegularExpression Id.
|
static int |
TEMPLATE_DEFAULT
Lexical state.
|
static int |
TEMPLATE_OPEN
RegularExpression Id.
|
static int |
TIMES
RegularExpression Id.
|
com.google.template.soy.soyparse.Token |
token
Current token.
|
static int |
TOKEN_NOT_WS
RegularExpression Id.
|
com.google.template.soy.soyparse.SoyFileParserTokenManager |
token_source
Generated Token Manager.
|
static int |
TOKEN_WS
RegularExpression Id.
|
static String[] |
tokenImage
Literal token values.
|
static int |
TRUE
RegularExpression Id.
|
static int |
UNEXPECTED_ALIAS
RegularExpression Id.
|
static int |
UNEXPECTED_CLOSE_TAG
RegularExpression Id.
|
static int |
UNEXPECTED_DELPACKAGE
RegularExpression Id.
|
static int |
UNEXPECTED_DELTEMPLATE
RegularExpression Id.
|
static int |
UNEXPECTED_DOUBLE_BRACE
RegularExpression Id.
|
static int |
UNEXPECTED_NAMESPACE
RegularExpression Id.
|
static int |
UNEXPECTED_NEWLINE
RegularExpression Id.
|
static int |
UNEXPECTED_TEMPLATE
RegularExpression Id.
|
static int |
UNEXPECTED_TOKEN
RegularExpression Id.
|
static int |
VARIANT_ATTR_DQ
RegularExpression Id.
|
static int |
VARIANT_ATTR_SQ
RegularExpression Id.
|
static int |
VBAR
RegularExpression Id.
|
static int |
WS
RegularExpression Id.
|
static int |
XXX_BRACE_INVALID
RegularExpression Id.
|
| Constructor and Description |
|---|
SoyFileParser(InputStream stream)
Constructor with InputStream.
|
SoyFileParser(InputStream stream,
String encoding)
Constructor with InputStream and supplied encoding
|
SoyFileParser(Reader stream)
Constructor.
|
SoyFileParser(com.google.template.soy.soyparse.SoyFileParserTokenManager tm)
Constructor with generated Token Manager.
|
SoyFileParser(SoyTypeRegistry typeRegistry,
PluginResolver pluginResolver,
IdGenerator nodeIdGen,
Reader input,
SoyFileKind soyFileKind,
String filePath,
ErrorReporter errorReporter,
com.google.common.collect.ImmutableSet<String> experimentalFeatures)
Constructor that takes a reader object providing the input.
|
| Modifier and Type | Method and Description |
|---|---|
void |
disable_tracing()
Disable tracing.
|
void |
enable_tracing()
Enable tracing.
|
ParseException |
generateParseException()
Generate ParseException.
|
com.google.template.soy.soyparse.Token |
getNextToken()
Get the next Token.
|
com.google.template.soy.soyparse.Token |
getToken(int index)
Get the specific Token.
|
static ExprNode |
parseExpression(String exprText,
PluginResolver resolver,
ErrorReporter errorReporter)
Attempts to parse the given input as a Soy expression.
|
static ExprNode |
parseExprOrDie(String exprText)
Attempts to parse the given input as a Soy expression.
|
SoyFileNode |
parseSoyFile()
Attempts to parse the given input as a Soy file.
|
static SoyType |
parseType(String typeText,
SoyTypeRegistry typeRegistry,
String filePath,
ErrorReporter errorReporter)
Attempts to parse the given input as a type node.
|
void |
ReInit(InputStream stream)
Reinitialise.
|
void |
ReInit(InputStream stream,
String encoding)
Reinitialise.
|
void |
ReInit(Reader stream)
Reinitialise.
|
void |
ReInit(com.google.template.soy.soyparse.SoyFileParserTokenManager tm)
Reinitialise.
|
public com.google.template.soy.soyparse.SoyFileParserTokenManager token_source
public com.google.template.soy.soyparse.Token token
public com.google.template.soy.soyparse.Token jj_nt
public static final int EOF
public static final int SOYDOC
public static final int ALIAS_OPEN
public static final int NAMESPACE_OPEN
public static final int DELPACKAGE_OPEN
public static final int CMD_DOUBLE_QUOTE
public static final int CMD_SINGLE_QUOTE
public static final int DATA_ATTR_DQ
public static final int DATA_ATTR_SQ
public static final int VARIANT_ATTR_DQ
public static final int VARIANT_ATTR_SQ
public static final int GENDERS_ATTR_DQ
public static final int GENDERS_ATTR_SQ
public static final int LOGONLY_ATTR_DQ
public static final int LOGONLY_ATTR_SQ
public static final int EQ_DOUBLE_QUOTE
public static final int EQ_SINGLE_QUOTE
public static final int END_DQ_EXPR_ATTR
public static final int END_SQ_EXPR_ATTR
public static final int DQ_ATTRIBUTE_VALUE
public static final int SQ_ATTRIBUTE_VALUE
public static final int DELTEMPLATE_OPEN
public static final int TEMPLATE_OPEN
public static final int CMD_CLOSE_TEMPLATE
public static final int CMD_CLOSE_DELTEMPLATE
public static final int DECL_BEGIN_PARAM
public static final int DECL_BEGIN_OPT_PARAM
public static final int DECL_BEGIN_INJECT_PARAM
public static final int DECL_BEGIN_OPT_INJECT_PARAM
public static final int XXX_BRACE_INVALID
public static final int CMD_FULL_SP
public static final int CMD_FULL_NIL
public static final int CMD_FULL_LF
public static final int CMD_FULL_CR
public static final int CMD_FULL_TAB
public static final int CMD_FULL_LB
public static final int CMD_FULL_RB
public static final int CMD_OPEN_LITERAL
public static final int CMD_BEGIN_CALL
public static final int CMD_BEGIN_DELCALL
public static final int CMD_CLOSE_CALL
public static final int CMD_CLOSE_DELCALL
public static final int CMD_BEGIN_PARAM
public static final int CMD_CLOSE_PARAM
public static final int CMD_BEGIN_MSG
public static final int CMD_BEGIN_FALLBACK_MSG
public static final int CMD_CLOSE_MSG
public static final int CMD_BEGIN_XID
public static final int CMD_BEGIN_CSS
public static final int CMD_BEGIN_IF
public static final int CMD_BEGIN_ELSEIF
public static final int CMD_FULL_ELSE
public static final int CMD_CLOSE_IF
public static final int CMD_BEGIN_LET
public static final int CMD_CLOSE_LET
public static final int CMD_BEGIN_FOR
public static final int CMD_CLOSE_FOR
public static final int CMD_BEGIN_PLURAL
public static final int CMD_CLOSE_PLURAL
public static final int CMD_BEGIN_SELECT
public static final int CMD_CLOSE_SELECT
public static final int CMD_BEGIN_SWITCH
public static final int CMD_CLOSE_SWITCH
public static final int CMD_BEGIN_CASE
public static final int CMD_FULL_DEFAULT
public static final int CMD_BEGIN_FOREACH
public static final int CMD_FULL_IFEMPTY
public static final int CMD_CLOSE_FOREACH
public static final int CMD_OPEN_LOG
public static final int CMD_CLOSE_LOG
public static final int CMD_FULL_DEBUGGER
public static final int CMD_BEGIN_PRINT
public static final int CMD_BEGIN_IMPLICIT_PRINT
public static final int CMD_BEGIN_VELOG
public static final int CMD_CLOSE_VELOG
public static final int CMD_END
public static final int CMD_SELF_CLOSE
public static final int NAME
public static final int CMD_COLON
public static final int CMD_EQ
public static final int CMD_DOT
public static final int LITERAL_RAW_TEXT_CONTENT
public static final int TOKEN_WS
public static final int TOKEN_NOT_WS
public static final int NULL
public static final int TRUE
public static final int FALSE
public static final int DEC_INTEGER
public static final int HEX_INTEGER
public static final int FLOAT
public static final int SINGLE_QUOTE
public static final int DOUBLE_QUOTE
public static final int SQ_STRING
public static final int DQ_STRING
public static final int UNEXPECTED_NEWLINE
public static final int QMARK
public static final int COLON
public static final int QCOLON
public static final int OR
public static final int AND
public static final int EQ
public static final int NOT_EQ
public static final int LANGLE
public static final int RANGLE
public static final int LT_EQ
public static final int GT_EQ
public static final int PLUS
public static final int MINUS
public static final int TIMES
public static final int DIV
public static final int MOD
public static final int NOT
public static final int DOT
public static final int QDOT
public static final int LBRACKET
public static final int RBRACKET
public static final int QLBRACKET
public static final int COMMA
public static final int LPAREN
public static final int RPAREN
public static final int VBAR
public static final int IDENT
public static final int IJ
public static final int DOLLAR_IDENT
public static final int LEGACY_AND
public static final int LEGACY_OR
public static final int LEGACY_NOT
public static final int UNEXPECTED_DOUBLE_BRACE
public static final int UNEXPECTED_CLOSE_TAG
public static final int UNEXPECTED_ALIAS
public static final int UNEXPECTED_NAMESPACE
public static final int UNEXPECTED_DELPACKAGE
public static final int UNEXPECTED_TEMPLATE
public static final int UNEXPECTED_DELTEMPLATE
public static final int WS
public static final int NOT_WS
public static final int RAW_IDENT
public static final int DEC_DIGITS
public static final int HEX_DIGIT
public static final int LINE_COMMENT
public static final int UNEXPECTED_TOKEN
public static final int DEFAULT
public static final int IN_CMD_TAG
public static final int EXPR
public static final int EXPR_NO_DOUBLE_QUOTE
public static final int TEMPLATE_DEFAULT
public static final int IN_MULTILINE_COMMENT
public static final int IN_SOYDOC
public static final int EXPR_NO_SINGLE_QUOTE
public static final int IN_DQ_ATTRIBUTE_VALUE
public static final int IN_SQ_ATTRIBUTE_VALUE
public static final int IN_LITERAL_BLOCK
public static final int IN_SQ_STRING
public static final int IN_DQ_STRING
public static final String[] tokenImage
public SoyFileParser(SoyTypeRegistry typeRegistry, PluginResolver pluginResolver, IdGenerator nodeIdGen, Reader input, SoyFileKind soyFileKind, String filePath, ErrorReporter errorReporter, com.google.common.collect.ImmutableSet<String> experimentalFeatures)
typeRegistry - The type registry for resolving type names.nodeIdGen - The node id generator for the tree being built.input - The input to parse.soyFileKind - The kind of this Soy file.filePath - The path of the source being parsed. Used for reporting.errorReporter - For reporting parse errors.public SoyFileParser(InputStream stream)
public SoyFileParser(InputStream stream, String encoding)
public SoyFileParser(Reader stream)
public SoyFileParser(com.google.template.soy.soyparse.SoyFileParserTokenManager tm)
public static ExprNode parseExprOrDie(String exprText)
@Nullable public static ExprNode parseExpression(String exprText, PluginResolver resolver, ErrorReporter errorReporter)
@Nullable public static SoyType parseType(String typeText, SoyTypeRegistry typeRegistry, String filePath, ErrorReporter errorReporter)
@Nullable public SoyFileNode parseSoyFile()
public void ReInit(InputStream stream)
public void ReInit(InputStream stream, String encoding)
public void ReInit(Reader stream)
public void ReInit(com.google.template.soy.soyparse.SoyFileParserTokenManager tm)
public final com.google.template.soy.soyparse.Token getNextToken()
public final com.google.template.soy.soyparse.Token getToken(int index)
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()