Package io.pebbletemplates.pebble.parser
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 ExpressionParser
An expression parser.private ParserOptions
parser optionsprivate TokenStream
The 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) void
pushBlockStack
(String blockName) void
setStream
(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:Parser
Parses the existing TokenStream, starting at the current Token, and ending when the stopCondition is fullfilled. -
getStream
Description copied from interface:Parser
Provides the stream of tokens which ultimately need to be "parsed" into Nodes. -
setStream
-
getExpressionParser
- Specified by:
getExpressionParser
in interfaceParser
-
peekBlockStack
- Specified by:
peekBlockStack
in interfaceParser
-
popBlockStack
- Specified by:
popBlockStack
in interfaceParser
-
pushBlockStack
- Specified by:
pushBlockStack
in interfaceParser
-