PEEL Shopping
Open source ecommerce : PEEL Shopping
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
Twig_Lexer Class Reference

Lexes a template string. More...

Inheritance diagram for Twig_Lexer:
Twig_LexerInterface

Public Member Functions

 __construct (Twig_Environment $env, array $options=array())
 
 tokenize ($code, $filename=null)
 Tokenizes a source code. More...
 

Data Fields

const STATE_DATA = 0
 
const STATE_BLOCK = 1
 
const STATE_VAR = 2
 
const STATE_STRING = 3
 
const STATE_INTERPOLATION = 4
 
const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A'
 
const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?/A'
 
const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As'
 
const REGEX_DQ_STRING_DELIM = '/"/A'
 
const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As'
 
const PUNCTUATION = '()[]{}?:.,|'
 

Protected Member Functions

 lexData ()
 
 lexBlock ()
 
 lexVar ()
 
 lexExpression ()
 
 lexRawData ($tag)
 
 lexComment ()
 
 lexString ()
 
 lexInterpolation ()
 
 pushToken ($type, $value= '')
 
 moveCursor ($text)
 
 getOperatorRegex ()
 
 pushState ($state)
 
 popState ()
 

Protected Attributes

 $tokens
 
 $code
 
 $cursor
 
 $lineno
 
 $end
 
 $state
 
 $states
 
 $brackets
 
 $env
 
 $filename
 
 $options
 
 $regexes
 
 $position
 
 $positions
 
 $currentVarBlockLine
 

Detailed Description

Lexes a template string.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Definition at line 18 of file Lexer.php.

Constructor & Destructor Documentation

__construct ( Twig_Environment  $env,
array  $options = array() 
)

Definition at line 49 of file Lexer.php.

Member Function Documentation

getOperatorRegex ( )
protected

Definition at line 369 of file Lexer.php.

lexBlock ( )
protected

Definition at line 201 of file Lexer.php.

lexComment ( )
protected

Definition at line 307 of file Lexer.php.

lexData ( )
protected

Definition at line 145 of file Lexer.php.

lexExpression ( )
protected

Definition at line 223 of file Lexer.php.

lexInterpolation ( )
protected

Definition at line 340 of file Lexer.php.

lexRawData (   $tag)
protected

Definition at line 291 of file Lexer.php.

lexString ( )
protected

Definition at line 316 of file Lexer.php.

lexVar ( )
protected

Definition at line 212 of file Lexer.php.

moveCursor (   $text)
protected

Definition at line 363 of file Lexer.php.

popState ( )
protected

Definition at line 400 of file Lexer.php.

pushState (   $state)
protected

Definition at line 394 of file Lexer.php.

pushToken (   $type,
  $value = '' 
)
protected

Definition at line 353 of file Lexer.php.

tokenize (   $code,
  $filename = null 
)

Tokenizes a source code.

Parameters
string$codeThe source code
string$filenameA unique identifier for the source code
Returns
Twig_TokenStream A token stream instance

Implements Twig_LexerInterface.

Definition at line 83 of file Lexer.php.

Field Documentation

$brackets
protected

Definition at line 27 of file Lexer.php.

$code
protected

Definition at line 21 of file Lexer.php.

$currentVarBlockLine
protected

Definition at line 34 of file Lexer.php.

$cursor
protected

Definition at line 22 of file Lexer.php.

$end
protected

Definition at line 24 of file Lexer.php.

$env
protected

Definition at line 28 of file Lexer.php.

$filename
protected

Definition at line 29 of file Lexer.php.

$lineno
protected

Definition at line 23 of file Lexer.php.

$options
protected

Definition at line 30 of file Lexer.php.

$position
protected

Definition at line 32 of file Lexer.php.

$positions
protected

Definition at line 33 of file Lexer.php.

$regexes
protected

Definition at line 31 of file Lexer.php.

$state
protected

Definition at line 25 of file Lexer.php.

$states
protected

Definition at line 26 of file Lexer.php.

$tokens
protected

Definition at line 20 of file Lexer.php.

const PUNCTUATION = '()[]{}?:.,|'

Definition at line 47 of file Lexer.php.

const REGEX_DQ_STRING_DELIM = '/"/A'

Definition at line 45 of file Lexer.php.

const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As'

Definition at line 46 of file Lexer.php.

const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A'

Definition at line 42 of file Lexer.php.

const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?/A'

Definition at line 43 of file Lexer.php.

const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As'

Definition at line 44 of file Lexer.php.

const STATE_BLOCK = 1

Definition at line 37 of file Lexer.php.

const STATE_DATA = 0

Definition at line 36 of file Lexer.php.

const STATE_INTERPOLATION = 4

Definition at line 40 of file Lexer.php.

const STATE_STRING = 3

Definition at line 39 of file Lexer.php.

const STATE_VAR = 2

Definition at line 38 of file Lexer.php.


The documentation for this class was generated from the following file:

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:44 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.