code: private function func()
      {
          $num_args = 0; // number of arguments received
          $function = strtoupper($this->currentToken);
          $result = ''; // initialize result
          $this->advance();
          $this->advance(); // eat the "("
          while ($this->currentToken != ')') {
              if ($num_args > 0) {
                  if ($this->currentToken == ',' || $this->currentToken == ';') {
                      $this->advance(); // eat the "," or ";"
                  } else {
                      throw new WriterException("Syntax error: comma expected in function $function, arg #{$num_args}");
                  }
                  $result2 = $this->condition();
                  $result = $this->createTree('arg', $result, $result2);
              } else { // first argument
                  $result2 = $this->condition();
                  $result = $this->createTree('arg', '', $result2);
              }
              ++$num_args;
          }
          if (!isset($this->functions[$function])) {
              throw new WriterException("Function $function() doesn't exist");
          }
          $args = $this->functions[$function][1];
          // If fixed number of args eg. TIME($i, $j, $k). Check that the number of args is valid.
          if (($args >= 0) and ($args != $num_args)) {
              throw new WriterException("Incorrect number of arguments in function $function() ");
          }
  
          $result = $this->createTree($function, $result, $num_args);
          $this->advance(); // eat the ")"
          return $result;
      }
docs: It parses a function call. It assumes the following rule:
  Func -> ( Expr [,Expr]* ).
  
  @return mixed The parsed ptg'd tree on success