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

Lowers the statements of stored programs and routes each to its rule.

Rule: MYSQL-PROGRAM-STATEMENT-LOWERING-001. Scope: sp_proc_stmt, ev_sql_stmt, ev_sql_stmt_inner, sp_proc_stmt_statement, sp_proc_stmt_unlabeled, sp_proc_stmts, sp_proc_stmts1, stored_routine_body, routine_string. An SQL statement inside a program re-enters the statement dispatcher. The semicolons that end the statements of a list are written back by the statement that holds the list. A dollar-quoted string is split into its tag and its text. Constructs: ExternalBody, DollarQuotedText. Terminates: every statement is a strict subtree; lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/sql-compound-statements.html, https://dev.mysql.com/doc/refman/9.1/en/create-procedure.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function statement(Node $statement): ProgramStatement|Statement

Lowers one statement of a program: a node of sp_proc_stmt or ev_sql_stmt_inner.

Parameters

$statementNode

Throws

ImplementationGap When a production has no rule
Test cases 1
Called from 6
Calls 13
public function statements(Node $list): list<ProgramStatement|Statement>

Lowers a statement list: a node of sp_proc_stmts or sp_proc_stmts1.

Parameters

$listNode

Throws

ImplementationGap When a production has no rule
Called from 8
Calls 4
public function dollarQuoted(Token $token): DollarQuotedText

Lowers a dollar-quoted string token into its tag and its text.

Parameters

$tokenToken
Called from 1
Calls 4

Private surface 3§

Implementation details, listed for orientation only.

private const ALTERNATIVES = ['sp_proc_stmt: sp_proc_stmt_statement' => true, 'sp_proc_stmt: sp_proc_stmt_re…
private const LISTS = ['sp_proc_stmts:', 'sp_proc_stmts: sp_proc_stmts sp_proc_stmt ;', 'sp_proc_stmt…
private Lowering $lowering

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 9
Method calls 13