Interface Twig_LexerInterface

Implemented byTwig_Lexer
Deprecated since version since 1.12 (to be removed in 3.0)

Interface implemented by lexer classes.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
tokenize() Tokenizes a source code. Twig_LexerInterface

Method Details

tokenize() public abstract method

Tokenizes a source code.

public abstract Twig_TokenStream tokenize ( $code, $filename null )
$code string

The source code

$filename string

A unique identifier for the source code

return Twig_TokenStream

A token stream instance

throws Twig_Error_Syntax

When the code is syntactically wrong