public class TemplateParser extends Object
Modifier and Type | Field and Description |
---|---|
private static Collection<Tokenizer.TokenType> |
CONDITION_WITH_APOSTROPHES_END_TOKENS |
private static Collection<Tokenizer.TokenType> |
EXPRESSION_END_TOKENS |
private Tokenizer |
tokenizer |
Constructor and Description |
---|
TemplateParser(String template) |
Modifier and Type | Method and Description |
---|---|
private Tokenizer.Token |
check(Tokenizer.TokenType expectedToken) |
TemplateEntry |
parse() |
private TemplateEntry |
parseCondition() |
private TemplateEntry |
parseContextSwitch() |
private TemplateEntry |
parseExpression(Collection<Tokenizer.TokenType> endTokens) |
private TemplateEntry |
parseVariable() |
private void |
skipWhitespace() |
private static final Collection<Tokenizer.TokenType> EXPRESSION_END_TOKENS
private static final Collection<Tokenizer.TokenType> CONDITION_WITH_APOSTROPHES_END_TOKENS
public TemplateParser(String template)
private Tokenizer.Token check(Tokenizer.TokenType expectedToken) throws ParseError
ParseError
public TemplateEntry parse() throws ParseError
ParseError
private TemplateEntry parseExpression(Collection<Tokenizer.TokenType> endTokens) throws ParseError
ParseError
private TemplateEntry parseVariable() throws ParseError
ParseError
private void skipWhitespace() throws ParseError
ParseError
private TemplateEntry parseCondition() throws ParseError
ParseError
private TemplateEntry parseContextSwitch() throws ParseError
ParseError