Fork me on GitHub

LexerImpl

In package com.mitchellbosecke.pebble.lexer

public final class LexerImpl extends Object implements Lexer

This class reads the template input and builds single items out of it.

This class is not thread safe.

Constructors

public LexerImpl(Syntax syntax, Collection<UnaryOperator> unaryOperators, Collection<BinaryOperator> binaryOperators)

Constructor

Parameters:
  • Syntax syntax

    The primary syntax

  • Collection<UnaryOperator> unaryOperators

    The available unary operators

  • Collection<BinaryOperator> binaryOperators

    The available binary operators

Methods

public TokenStream tokenize(Reader reader, String name)

This is the main method used to tokenize the raw contents of a template.

Parameters:
  • Reader reader

    The reader provided from the Loader

  • String name

    The name of the template (used for meaningful error messages)