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

Lowers the simple_expr level: names, literals, parameters, variables, calls and the prefix and postfix operators.

Rule: MYSQL-SIMPLE-EXPR-001. Scope: simple_expr, not2. COLLATE and the concatenation || of PIPES_AS_CONCAT are left recursive; the left spine is walked in a loop. A function-like form is handed to the call family, a name, literal, parameter or variable to the leaf rules, and the bracketed, subquery and keyword forms to MYSQL-SIMPLE-FORM-001 and MYSQL-CONSTRUCT-001. Under HIGH_NOT_PRECEDENCE the keyword NOT is the tight negation !. Constructs: Collated, Concatenation, Unary. Terminates: the spine loop descends one left child per step; every other child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/expressions.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function leaf(string $kind, Node $leaf): Scalar
public function negation(Node $keyword): void

Confirms the tight negation keyword: !, or NOT under HIGH_NOT_PRECEDENCE.

Parameters

$keywordNode

Throws

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

Private surface 5§

Implementation details, listed for orientation only.

private const CALLS = ['simple_expr: function_call_keyword' => true, 'simple_expr: function_call_nonk…
private const LEAVES = ['simple_expr: simple_ident' => 'column', 'simple_expr: literal' => 'literal', …
private const PREFIX = ['simple_expr: + simple_expr' => \SqlSemantics\Platform\MySql\Statement\Express…
private const POSTFIX = ['simple_expr: simple_expr COLLATE_SYM ident_or_text' => true, 'simple_expr: si…
private Lowering $lowering

Test cases 5§

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

Dedicated tests 5

Relations§

Instantiated in 1
Method calls 1