Class Twig_ExpressionParser

InheritanceTwig_ExpressionParser

Parses expressions.

This parser implements a "Precedence climbing" algorithm.

See also:

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
OPERATOR_LEFT 1 Twig_ExpressionParser
OPERATOR_RIGHT 2 Twig_ExpressionParser

Property Details

$binaryOperators protected property
protected $binaryOperators null
$parser protected property
protected $parser null
$unaryOperators protected property
protected $unaryOperators null

Method Details

__construct() public method

public void __construct ( Twig_Parser $parser, array $unaryOperators, array $binaryOperators )
$parser
$unaryOperators
$binaryOperators
checkConstantExpression() protected method

protected void checkConstantExpression ( Twig_NodeInterface $node )
$node
getFilterNodeClass() protected method

protected void getFilterNodeClass ( $name, $line )
$name
$line
getFunctionNode() public method

public void getFunctionNode ( $name, $line )
$name
$line
getFunctionNodeClass() protected method

protected void getFunctionNodeClass ( $name, $line )
$name
$line
getPrimary() protected method

protected void getPrimary ( )
isBinary() protected method

protected void isBinary ( Twig_Token $token )
$token
isUnary() protected method

protected void isUnary ( Twig_Token $token )
$token
parseArguments() public method

Parses arguments.

public Twig_Node parseArguments ( $namedArguments false, $definition false )
$namedArguments bool

Whether to allow named arguments or not

$definition bool

Whether we are parsing arguments for a function definition

throws Twig_Error_Syntax
parseArrayExpression() public method

public void parseArrayExpression ( )
parseAssignmentExpression() public method

public void parseAssignmentExpression ( )
parseConditionalExpression() protected method

protected void parseConditionalExpression ( $expr )
$expr
parseExpression() public method

public void parseExpression ( $precedence 0 )
$precedence
parseFilterExpression() public method

public void parseFilterExpression ( $node )
$node
parseFilterExpressionRaw() public method

public void parseFilterExpressionRaw ( $node, $tag null )
$node
$tag
parseHashExpression() public method

public void parseHashExpression ( )
parseMultitargetExpression() public method

public void parseMultitargetExpression ( )
parsePostfixExpression() public method

public void parsePostfixExpression ( $node )
$node
parsePrimaryExpression() public method

public void parsePrimaryExpression ( )
parseStringExpression() public method

public void parseStringExpression ( )
parseSubscriptExpression() public method

public void parseSubscriptExpression ( $node )
$node