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

The lowering of one MySQL parse tree: the statement dispatcher and the entry rules of every family.

Rule: MYSQL-INPUT-001. Scope: start_entry, sql_statement, simple_statement_or_begin, simple_statement, opt_end_of_input (8.0 and later); query, verb_clause, statement (5.6, 5.7); and the routing of create, alter and drop. One input holds at most one statement; the empty input holds none. A statement is handed to the family that owns its rule (MYSQL-STATEMENT-ROUTES-001, MYSQL-DEFINITION-ROUTES-001). The other start_entry alternatives begin with a grammar selector token the lexer never produces, so no SQL text reaches them. An optimizer hint comment is reported as a missing rule (MYSQL-OPTIMIZER-HINTS-001). Terminates: the root rules are unit productions over strict subtrees. Source: https://dev.mysql.com/doc/refman/8.4/en/sql-statements.html. Status: Implemented.

Properties§

public NameRule $names
public LiteralRule $literals
public NumberRule $numbers
public VariableRule $variables
public OptionRule $options
public CharsetRule $charsets
public UserRule $users
public TypeRule $types
public ExpressionRules $expressions
public CallRules $calls
public QueryRules $queries
public DmlRules $dml
public TableDefinitionRules $tableDefinitions
public TableChangeRules $tableChanges
public RoutineRules $routines
public AccountRules $accounts
public ReplicationRules $replication
public ServerRules $server
public UtilityRules $utility
public Productions $productions
public Leaves $leaves
public LanguageProfile $profile

Methods§

public function __construct(
    public Productions $productions,
    public Leaves $leaves,
    public LanguageProfile $profile,
)

Parameters

$productionsProductionsThe productions of the grammar release
$leavesLeavesThe record of operand leaves of this analysis
$profileLanguageProfileThe language profile the tree was parsed under
Calls 19
public function statements(Node $input): list<Statement>

Lowers a complete input into the statements it holds: one, or none for an empty input.

Parameters

$inputNode

Returns

list<Statement>

Throws

ImplementationGap When a production has no rule or the input holds an optimizer hint comment
Test cases 2
Called from 1
Calls 11
public function statement(Node $statement): Statement
public function form(Node $node): Form

Answers the typed view of the production a node matched.

Parameters

$nodeNode

Returns

Test cases 29
Called from 593
Calls 1

Private surface 2§

Implementation details, listed for orientation only.

private const SELECTED = ['start_entry: GRAMMAR_SELECTOR_EXPR bit_expr END_OF_INPUT' => true, 'start_ent…
private const TERMINATED = ['sql_statement: simple_statement_or_begin ; opt_end_of_input' => true, 'sql_st…

Test cases 344§

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

Dedicated tests 3
Other tests reaching this symbol 341

Relations§

Instantiated in 1
Method calls 596
Type declarations 140