PHP Class Twig_Lexer, php-framework-benchmarks

Author: Fabien Potencier ([email protected])
Inheritance: implements Twig_LexerInterface
Show file Open project: pmjones/php-framework-benchmarks Class Usage Examples

Protected Properties

Property Type Description
$code
$cursor
$end
$env
$filename
$lineno
$operatorRegex
$options
$position
$pushedBack

Public Methods

Method Description
__construct ( Twig_Environment $env = null, array $options = [] )
setEnvironment ( Twig_Environment $env )
sortByLength ( $a, $b )
tokenize ( string $code, string $filename = 'n/a' ) : Twig_TokenStream Tokenizes a source code.

Protected Methods

Method Description
getOperatorRegex ( )
lexBlock ( )
lexData ( )
lexExpression ( )
lexVar ( )
moveCursor ( $text )
moveLineNo ( $text )
nextToken ( ) Parses the next token and returns it.

Method Details

__construct() public method

public __construct ( Twig_Environment $env = null, array $options = [] )
$env Twig_Environment
$options array

getOperatorRegex() protected method

protected getOperatorRegex ( )

lexBlock() protected method

protected lexBlock ( )

lexData() protected method

protected lexData ( )

lexExpression() protected method

protected lexExpression ( )

lexVar() protected method

protected lexVar ( )

moveCursor() protected method

protected moveCursor ( $text )

moveLineNo() protected method

protected moveLineNo ( $text )

nextToken() protected method

Parses the next token and returns it.
protected nextToken ( )

setEnvironment() public method

public setEnvironment ( Twig_Environment $env )
$env Twig_Environment

sortByLength() public method

public sortByLength ( $a, $b )

tokenize() public method

Tokenizes a source code.
public tokenize ( string $code, string $filename = 'n/a' ) : Twig_TokenStream
$code string The source code
$filename string A unique identifier for the source code
return Twig_TokenStream A token stream instance

Property Details

$code protected property

protected $code

$cursor protected property

protected $cursor

$end protected property

protected $end

$env protected property

protected $env

$filename protected property

protected $filename

$lineno protected property

protected $lineno

$operatorRegex protected property

protected $operatorRegex

$options protected property

protected $options

$position protected property

protected $position

$pushedBack protected property

protected $pushedBack