classLowering
final class Lowering
The lowering of one SQLite parse tree: the entry rule and the rule objects of one analysis.
Rule: SQLITE-INPUT-001. Scope: input, cmdlist, ecmd, cmdx, cmd. An input is the ordered list of its commands; an empty command contributes nothing. Terminates: the command list is flattened iteratively and each command is a strict subtree. Source: https://sqlite.org/lang.html. Status: Implemented.
Properties§
public NameRule $namespublic FlagRule $flagspublic TriviaRule $triviapublic LiteralRule $literalspublic TypeNameRule $typeNamespublic ConflictRule $conflictspublic ExpressionRule $expressionspublic SortRule $orderingpublic SelectRule $selectspublic ResultRule $resultspublic FromRule $inputspublic WithRule $commonTablespublic WindowRule $windowspublic MutationRule $mutationspublic TriggerRule $triggerspublic QueryCommands $queryCommandspublic DefinitionCommands $definitionCommandspublic Productions $productionspublic Leaves $leavesMethods§
public function __construct(public Productions $productions, public Leaves $leaves)Parameters
$productions | Productions | The productions of the grammar release |
$leaves | Leaves | The record of operand leaves of this analysis |
Calls 17
- new NameRule line 134
- new FlagRule line 135
- new TriviaRule line 136
- new LiteralRule line 137
- new TypeNameRule line 138
- new ConflictRule line 139
- new ExpressionRule line 140
- new SortRule line 141
- new SelectRule line 142
- new ResultRule line 143
- new FromRule line 144
- new WithRule line 145
- new WindowRule line 146
- new MutationRule line 147
- new TriggerRule line 148
- new QueryCommands line 149
- new DefinitionCommands line 150
Lowers a complete input into its statements.
Parameters
$input | Node |
Returns
list<Statement>Throws
ImplementationGap When a production has no ruleTest cases 2
Called from 1
Calls 5
- method-call Productions::form() line 162
- static-call ImplementationGap::production() line 164
- method-call Lists::items() line 171
- new Lists line 171
- method-call Lowering::terminated() line 172
Lowers one terminated command; an empty command is no statement.
Parameters
$command | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 2
Called from 1
Calls 6
- method-call Productions::form() line 188
- method-call TriviaRule::index() line 189
- method-call Lowering::command() line 193
- method-call Lowering::unwrapped() line 193
- method-call DefinitionCommands::explained() line 194
- static-call ImplementationGap::production() line 195
Answers the command inside a cmdx, which the grammar wraps around every command.
Parameters
$cmdx | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 3
Called from 2
Calls 2
- method-call Productions::form() line 206
- static-call ImplementationGap::production() line 210
Lowers one command: the commands that read or write rows first, every other command otherwise.
Parameters
$command | Node |
Returns
Test cases 1
Called from 2
Calls 3
- method-call Productions::form() line 219
- method-call QueryCommands::command() line 221
- method-call DefinitionCommands::command() line 221
Test cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 7
LoweringTest::testCommandLowersAQueryCommandAndADefinitionCommandcallsLoweringTest::testCommandUsesTheRuleObjectsOfTheSameLoweringcallsLoweringTest::testStatementsLowersEveryCommandInOrderAndSkipsEmptyOnescallsLoweringTest::testStatementsRecordsTheOperandLeavesItLowerscallsLoweringTest::testTerminatedAnswersNullForAnEmptyCommandcallsLoweringTest::testTerminatedWrapsAnExplainedCommandcallsLoweringTest::testUnwrappedAnswersTheCommandInsideTheGrammarWrappercalls
Other tests reaching this symbol 1
Relations§
Instantiated in 1
Method calls 1
Type declarations 30
- type SqlSemantics\Platform\Sqlite\Lowering\Definition\ColumnRule packages/sql-semantics-sqlite/src/Lowering/Definition/ColumnRule.php:51
- type SqlSemantics\Platform\Sqlite\Lowering\Definition\ConnectionRule packages/sql-semantics-sqlite/src/Lowering/Definition/ConnectionRule.php:38
- type SqlSemantics\Platform\Sqlite\Lowering\Definition\CreateTableRule packages/sql-semantics-sqlite/src/Lowering/Definition/CreateTableRule.php:37
- type SqlSemantics\Platform\Sqlite\Lowering\Definition\DefinitionCommands packages/sql-semantics-sqlite/src/Lowering/Definition/DefinitionCommands.php:45
- type SqlSemantics\Platform\Sqlite\Lowering\Definition\ForeignKeyRule packages/sql-semantics-sqlite/src/Lowering/Definition/ForeignKeyRule.php:58
- type SqlSemantics\Platform\Sqlite\Lowering\Definition\MaintenanceRule packages/sql-semantics-sqlite/src/Lowering/Definition/MaintenanceRule.php:40
- type SqlSemantics\Platform\Sqlite\Lowering\Definition\SchemaRule packages/sql-semantics-sqlite/src/Lowering/Definition/SchemaRule.php:58
- type SqlSemantics\Platform\Sqlite\Lowering\Definition\TableConstraintRule packages/sql-semantics-sqlite/src/Lowering/Definition/TableConstraintRule.php:49
- type SqlSemantics\Platform\Sqlite\Lowering\Definition\TransactionRule packages/sql-semantics-sqlite/src/Lowering/Definition/TransactionRule.php:41
- type SqlSemantics\Platform\Sqlite\Lowering\Definition\VirtualTableRule packages/sql-semantics-sqlite/src/Lowering/Definition/VirtualTableRule.php:54
- type SqlSemantics\Platform\Sqlite\Lowering\Definition\WordRule packages/sql-semantics-sqlite/src/Lowering/Definition/WordRule.php:35
- type SqlSemantics\Platform\Sqlite\Lowering\Expression\CallRule packages/sql-semantics-sqlite/src/Lowering/Expression/CallRule.php:33
- type SqlSemantics\Platform\Sqlite\Lowering\Expression\ExpressionRule packages/sql-semantics-sqlite/src/Lowering/Expression/ExpressionRule.php:52
- type SqlSemantics\Platform\Sqlite\Lowering\Expression\OperatorRule packages/sql-semantics-sqlite/src/Lowering/Expression/OperatorRule.php:35
- type SqlSemantics\Platform\Sqlite\Lowering\Expression\PredicateRule packages/sql-semantics-sqlite/src/Lowering/Expression/PredicateRule.php:39
- type SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:36
- type SqlSemantics\Platform\Sqlite\Lowering\Leaf\ConflictRule packages/sql-semantics-sqlite/src/Lowering/Leaf/ConflictRule.php:27
- type SqlSemantics\Platform\Sqlite\Lowering\Leaf\FlagRule packages/sql-semantics-sqlite/src/Lowering/Leaf/FlagRule.php:25
- type SqlSemantics\Platform\Sqlite\Lowering\Leaf\LiteralRule packages/sql-semantics-sqlite/src/Lowering/Leaf/LiteralRule.php:41
- type SqlSemantics\Platform\Sqlite\Lowering\Leaf\NameRule packages/sql-semantics-sqlite/src/Lowering/Leaf/NameRule.php:33
- type SqlSemantics\Platform\Sqlite\Lowering\Leaf\TypeNameRule packages/sql-semantics-sqlite/src/Lowering/Leaf/TypeNameRule.php:39
- type SqlSemantics\Platform\Sqlite\Lowering\Mutation\MutationRule packages/sql-semantics-sqlite/src/Lowering/Mutation/MutationRule.php:52
- type SqlSemantics\Platform\Sqlite\Lowering\Mutation\UpsertRule packages/sql-semantics-sqlite/src/Lowering/Mutation/UpsertRule.php:31
- type SqlSemantics\Platform\Sqlite\Lowering\Query\FromRule packages/sql-semantics-sqlite/src/Lowering/Query/FromRule.php:44
- type SqlSemantics\Platform\Sqlite\Lowering\Query\QueryCommands packages/sql-semantics-sqlite/src/Lowering/Query/QueryCommands.php:25
- type SqlSemantics\Platform\Sqlite\Lowering\Query\ResultRule packages/sql-semantics-sqlite/src/Lowering/Query/ResultRule.php:40
- type SqlSemantics\Platform\Sqlite\Lowering\Query\SelectRule packages/sql-semantics-sqlite/src/Lowering/Query/SelectRule.php:52
- type SqlSemantics\Platform\Sqlite\Lowering\Query\SortRule packages/sql-semantics-sqlite/src/Lowering/Query/SortRule.php:36
- type SqlSemantics\Platform\Sqlite\Lowering\Query\WithRule packages/sql-semantics-sqlite/src/Lowering/Query/WithRule.php:30
- type SqlSemantics\Platform\Sqlite\Lowering\Trigger\TriggerRule packages/sql-semantics-sqlite/src/Lowering/Trigger/TriggerRule.php:46