class Parser
Parsers a token stream.
This parser implements a "Precedence climbing" algorithm.
OPERATOR_LEFT | |
OPERATOR_RIGHT |
__construct(array $functions) | ||
Node | parse(TokenStream $stream, array $names = array()) Converts a token stream to a node tree. | |
parseExpression($precedence = 0) | ||
getPrimary() | ||
parseConditionalExpression($expr) | ||
parsePrimaryExpression() | ||
parseArrayExpression() | ||
parseHashExpression() | ||
parsePostfixExpression($node) | ||
parseArguments() Parses arguments. |
array | $functions |
Converts a token stream to a node tree.
The valid names is an array where the values are the names that the user can use in an expression.
If the variable name in the compiled PHP code must be different, define it as the key.
For instance, ['this' => 'container'] means that the variable 'container' can be used in the expression but the compiled code will use 'this'.
TokenStream | $stream | A token stream instance |
array | $names | An array of valid names |
Node | A node tree |
SyntaxError |
$precedence |
$expr |
$node |
Parses arguments.
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/ExpressionLanguage/Parser.html