PHP Class Twig_Lexer, php-framework-benchmarks

Author: Fabien Potencier ([email protected])
Inheritance: implements Twig_LexerInterface
Exibir arquivo 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_oe property

protected $code

$cursor protected_oe property

protected $cursor

$end protected_oe property

protected $end

$env protected_oe property

protected $env

$filename protected_oe property

protected $filename

$lineno protected_oe property

protected $lineno

$operatorRegex protected_oe property

protected $operatorRegex

$options protected_oe property

protected $options

$position protected_oe property

protected $position

$pushedBack protected_oe property

protected $pushedBack