public function createMethodCallNode($object, $function, array $arguments = []) { $functionNode = new FunctionNode($function, $arguments); $functionNode->setObject($object); return $functionNode; }
private function parseIdentifier($identifier) { if ($this->stream->nextTokenIf(Token::PUNCTUATION, '(')) { //function call $node = new FunctionNode($identifier, $this->parseArgumentList()); $lastOperator = $this->operatorStack->top(); if ($lastOperator instanceof PropertyAccessOperator) { $this->operatorStack->pop(); $node->setObject($this->operandStack->pop()); } } else { $node = new IdentifierNode($identifier); } $this->operandStack->push($node); }