Class ParserImpl
java.lang.Object
io.pebbletemplates.pebble.parser.ParserImpl
- All Implemented Interfaces:
Parser
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<String, BinaryOperator> Binary operatorsprivate LinkedList<String> used to keep track of the name of the block that we are currently inside of.private ExpressionParserAn expression parser.private ParserOptionsparser optionsprivate TokenStreamThe TokenStream that we are converting into an Abstract Syntax Tree.private final Map<String, TokenParser> Token parsersprivate final Map<String, UnaryOperator> Unary operators -
Constructor Summary
ConstructorsConstructorDescriptionParserImpl(Map<String, UnaryOperator> unaryOperators, Map<String, BinaryOperator> binaryOperators, Map<String, TokenParser> tokenParsers, ParserOptions parserOptions) Constructor -
Method Summary
Modifier and TypeMethodDescriptionProvides the stream of tokens which ultimately need to be "parsed" into Nodes.parse(TokenStream stream) voidpushBlockStack(String blockName) voidsetStream(TokenStream stream) subparse()subparse(StoppingCondition stopCondition) Parses the existing TokenStream, starting at the current Token, and ending when the stopCondition is fullfilled.
-
Field Details
-
binaryOperators
Binary operators -
unaryOperators
Unary operators -
tokenParsers
Token parsers -
expressionParser
An expression parser. -
stream
The TokenStream that we are converting into an Abstract Syntax Tree. -
blockStack
used to keep track of the name of the block that we are currently inside of. This is purely just for the parent() function. -
parserOptions
parser options
-
-
Constructor Details
-
ParserImpl
public ParserImpl(Map<String, UnaryOperator> unaryOperators, Map<String, BinaryOperator> binaryOperators, Map<String, TokenParser> tokenParsers, ParserOptions parserOptions) Constructor- Parameters:
unaryOperators- A map of unary operatorsbinaryOperators- A map of binary operatorstokenParsers- A map of token parsers
-
-
Method Details
-
parse
-
subparse
-
subparse
Description copied from interface:ParserParses the existing TokenStream, starting at the current Token, and ending when the stopCondition is fullfilled. -
getStream
Description copied from interface:ParserProvides the stream of tokens which ultimately need to be "parsed" into Nodes. -
setStream
-
getExpressionParser
- Specified by:
getExpressionParserin interfaceParser
-
peekBlockStack
- Specified by:
peekBlockStackin interfaceParser
-
popBlockStack
- Specified by:
popBlockStackin interfaceParser
-
pushBlockStack
- Specified by:
pushBlockStackin interfaceParser
-