Exemple #1
0
 protected function procMethodInvoke(Token $token)
 {
     $this->debug(__METHOD__, __LINE__, "Found a method call: {$token->getValue()}");
     $method = $token->getValue();
     // Checkout method is available
     if (!$this->extension_manager->resolve($method)) {
         throw new SyntaxException($token->getLine(), $token->getColumn(), 'Call to undefined method: ' . $token->getValue(), __FILE__, __LINE__);
     }
     // Begin processing ...
     $token = $this->getToken();
     if ($token->getValue() != '(') {
         throw new SyntaxException($token->getLine(), $token->getColumn(), "Expected '(' but got '{$token->getValue()}'", __FILE__, __LINE__);
     }
     $arguments = array();
     $token = $this->getToken();
     while ($token->getValue() != ')') {
         $value = NULL;
         switch ($token->getValue()) {
             case ',':
                 break;
             default:
                 $vartype = $this->evalExp($value, $token);
                 break;
         }
         // $arguments[] = array($value, $vartype);
         $arguments[] = $value;
         $token = $this->getToken();
     }
     return $this->extension_manager->call($method, $arguments);
 }