Exemple #1
0
 public function createMethodCallNode($object, $function, array $arguments = [])
 {
     $functionNode = new FunctionNode($function, $arguments);
     $functionNode->setObject($object);
     return $functionNode;
 }
Exemple #2
0
 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);
 }