Class ParserImpl

java.lang.Object
io.pebbletemplates.pebble.parser.ParserImpl
All Implemented Interfaces:
Parser

public class ParserImpl extends Object implements Parser
  • Field Details

    • binaryOperators

      private final Map<String,BinaryOperator> binaryOperators
      Binary operators
    • unaryOperators

      private final Map<String,UnaryOperator> unaryOperators
      Unary operators
    • tokenParsers

      private final Map<String,TokenParser> tokenParsers
      Token parsers
    • expressionParser

      private ExpressionParser expressionParser
      An expression parser.
    • stream

      private TokenStream stream
      The TokenStream that we are converting into an Abstract Syntax Tree.
    • blockStack

      private LinkedList<String> 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

      private ParserOptions parserOptions
      parser options
  • Constructor Details

  • Method Details

    • parse

      public RootNode parse(TokenStream stream)
      Specified by:
      parse in interface Parser
    • subparse

      public BodyNode subparse()
      Specified by:
      subparse in interface Parser
    • subparse

      public BodyNode subparse(StoppingCondition stopCondition)
      Description copied from interface: Parser
      Parses the existing TokenStream, starting at the current Token, and ending when the stopCondition is fullfilled.
      Specified by:
      subparse in interface Parser
      Parameters:
      stopCondition - The condition to stop parsing a segment of the template.
      Returns:
      A node representing the parsed section
    • getStream

      public TokenStream getStream()
      Description copied from interface: Parser
      Provides the stream of tokens which ultimately need to be "parsed" into Nodes.
      Specified by:
      getStream in interface Parser
      Returns:
      TokenStream
    • setStream

      public void setStream(TokenStream stream)
    • getExpressionParser

      public ExpressionParser getExpressionParser()
      Specified by:
      getExpressionParser in interface Parser
    • peekBlockStack

      public String peekBlockStack()
      Specified by:
      peekBlockStack in interface Parser
    • popBlockStack

      public String popBlockStack()
      Specified by:
      popBlockStack in interface Parser
    • pushBlockStack

      public void pushBlockStack(String blockName)
      Specified by:
      pushBlockStack in interface Parser