unset($this->stream,
$this->names
);
return $node;
} /**
* @return Node\Node
*/
public function parseExpression(int
$precedence = 0
) { $expr =
$this->
getPrimary();
$token =
$this->stream->current;
while ($token->
test(Token::OPERATOR_TYPE
) &&
isset($this->binaryOperators
[$token->value
]) &&
$this->binaryOperators
[$token->value
]['precedence'
] >=
$precedence) { $op =
$this->binaryOperators
[$token->value
];
$this->stream->
next();
$expr1 =
$this->
parseExpression(self::OPERATOR_LEFT ===
$op['associativity'
] ?
$op['precedence'
] + 1 :
$op['precedence'
]);
$expr =
new Node\
BinaryNode($token->value,
$expr,
$expr1);
$token =
$this->stream->current;
}