public function FunctionDeclaration()
{
$token = $this->_lexer->lookahead;
$funcName = strtolower($token['value']);
// Check for built-in functions first!
if (isset(self::$_STRING_FUNCTIONS[$funcName])) {
return $this->FunctionsReturningStrings();
} else if (isset(self::$_NUMERIC_FUNCTIONS[$funcName])) {
return $this->FunctionsReturningNumerics();
} else if (isset(self::$_DATETIME_FUNCTIONS[$funcName])) {
return $this->FunctionsReturningDatetime();
}
// Check for custom functions afterwards
$config = $this->_em->getConfiguration();
if ($config->getCustomStringFunction($funcName) !== null) {
return $this->CustomFunctionsReturningStrings();
} else if ($config->getCustomNumericFunction($funcName) !== null) {
return $this->CustomFunctionsReturningNumerics();
} else if ($config->getCustomDatetimeFunction($funcName) !== null) {
return $this->CustomFunctionsReturningDatetime();
}
$this->syntaxError('known function', $token);
}