final class FunctionRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.

Lowers the function calls with a keyword name and a plain argument list, CHAR, TRIM and the calls written as name(...).

Rule: MYSQL-CALL-FUNCTION-001. Scope: function_call_keyword, function_call_nonkeyword, function_call_conflict and geometry_function except the special syntaxes of TemporalRule, WeightRule and JsonRule; function_call_generic, opt_udf_expr_list, udf_expr_list, udf_expr. Each keyword production names its function and the positions of its arguments (an expression, or an expression list that continues the arguments). SUBSTRING with FROM and FOR is SUBSTRING with commas (the synonyms of CallNoise). Constructs: KeywordCall, CharCall, Trim, Position, FunctionCall, CallArgument. Terminates: the argument list is flattened in a loop; every other child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/function-resolution.html, https://dev.mysql.com/doc/refman/8.4/en/built-in-function-reference.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function claims(string $signature): bool

Tells whether a production is one of this rule.

Parameters

$signaturestring

Returns

bool
Test cases 1
Called from 1
Calls 3
public function keyword(
    Form $form,
    KeywordFunction $function,
    list<int> $positions,
    int|null $list,
): KeywordCall

Lowers a keyword production from its table row.

Parameters

$formForm
$functionKeywordFunction
$positionslist<int>The positions of the expressions
$listint|nullThe position of an expression list that follows them
Test cases 1
Called from 1
Calls 4
public function niladic(Form $form, KeywordFunction $function): KeywordCall
public function arguments(Node $list): list<CallArgument>

Lowers the arguments of an unqualified call: a node of opt_udf_expr_list.

Parameters

$listNode

Returns

Throws

ImplementationGap When a production has no rule
Test cases 1
Called from 1
Calls 5
public function argument(Node $argument): CallArgument

Lowers one argument of an unqualified call: a node of udf_expr.

Parameters

$argumentNode

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 1
Calls 4

Private surface 3§

Implementation details, listed for orientation only.

private const KEYWORDS = ['function_call_keyword: DATE_SYM ( expr )' => [\SqlSemantics\Platform\MySql\St…
private const TRIMS = ['function_call_keyword: TRIM ( expr )' => [null, null, 2], 'function_call_keyw…
private Lowering $lowering

Test cases 8§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 8

Relations§

Instantiated in 1
Method calls 2