classFromRule
final class FromRule
Lowers the FROM clause and the table reference lists of every grammar generation, handing each table factor to its generation.
Rule: MYSQL-FROM-001. Scope: from_clause, opt_from_clause, from_tables, table_reference_list, and the dispatch of table_factor. FROM DUAL is the dummy table; references separated by commas are a comma list; one reference is itself. Constructs: Dual, TableList. Terminates: lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/select.html, https://dev.mysql.com/doc/refman/8.4/en/join.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
Lowers an optional FROM clause; an absent clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 4
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::full() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:96
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:201
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\PrimaryRule::specification() packages/sql-semantics-mysql/src/Lowering/Query/Modern/PrimaryRule.php:94
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Shared\FromRule::from() packages/sql-semantics-mysql/src/Lowering/Query/Shared/FromRule.php:59
Calls 4
- method-call Lowering::form() line 55
- method-call FromRule::from() line 59
- method-call FromRule::tables() line 60
- static-call ImplementationGap::production() line 61
Lowers the tables of a FROM clause, of UPDATE or of DELETE: one reference, a comma list or DUAL.
Parameters
$tables | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::from() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:168
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Shared\FromRule::from() packages/sql-semantics-mysql/src/Lowering/Query/Shared/FromRule.php:60
Calls 3
- method-call FromRule::members() line 72
- function-call
countline 74 - new TableList line 74
Lowers the references of a FROM clause in written order.
Parameters
$tables | Node |
Returns
list<Relation>Throws
ImplementationGap When a production has no ruleCalled from 4
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\FactorRule::parens() packages/sql-semantics-mysql/src/Lowering/Query/Modern/FactorRule.php:75
- method-call SqlSemantics\Platform\MySql\Lowering\Query\QueryRules::tables() packages/sql-semantics-mysql/src/Lowering/Query/QueryRules.php:197
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Shared\FromRule::tables() packages/sql-semantics-mysql/src/Lowering/Query/Shared/FromRule.php:72
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Shared\FromRule::members() packages/sql-semantics-mysql/src/Lowering/Query/Shared/FromRule.php:90
Calls 10
- method-call Lowering::form() line 85
- new Dual line 87
- method-call FromRule::members() line 90
- method-call JoinRule::list() line 93
- new JoinRule line 93
- static-call ImplementationGap::production() line 96
- method-call Lists::items() line 99
- new Lists line 99
- method-call ReferenceRule::reference() line 100
- new ReferenceRule line 100
Lowers a table factor of either grammar generation.
Parameters
$factor | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 4
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\JoinRule::reference() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/JoinRule.php:116
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\JoinRule::step() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/JoinRule.php:170
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ReferenceRule::reference() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ReferenceRule.php:80
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ReferenceRule::step() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ReferenceRule.php:122
Calls 6
- method-call Lowering::form() line 113
- class-const FromRule::MODERN() line 114
- method-call FactorRule::factor() line 115
- new FactorRule line 115
- method-call FactorRule::factor() line 118
- new FactorRule line 118
Private surface 2§
Implementation details, listed for orientation only.
private const MODERN = ['table_factor: single_table' => true, 'table_factor: single_table_parens' => t…private Lowering $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
FromRuleTestcalls
Relations§
Instantiated in 10
- new SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::full() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:96
- new SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::from() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:168
- new SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:201
- new SqlSemantics\Platform\MySql\Lowering\Query\Legacy\JoinRule::reference() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/JoinRule.php:116
- new SqlSemantics\Platform\MySql\Lowering\Query\Legacy\JoinRule::step() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/JoinRule.php:170
- new SqlSemantics\Platform\MySql\Lowering\Query\Modern\FactorRule::parens() packages/sql-semantics-mysql/src/Lowering/Query/Modern/FactorRule.php:75
- new SqlSemantics\Platform\MySql\Lowering\Query\Modern\PrimaryRule::specification() packages/sql-semantics-mysql/src/Lowering/Query/Modern/PrimaryRule.php:94
- new SqlSemantics\Platform\MySql\Lowering\Query\Modern\ReferenceRule::reference() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ReferenceRule.php:80
- new SqlSemantics\Platform\MySql\Lowering\Query\Modern\ReferenceRule::step() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ReferenceRule.php:122
- new SqlSemantics\Platform\MySql\Lowering\Query\QueryRules::tables() packages/sql-semantics-mysql/src/Lowering/Query/QueryRules.php:197
Method calls 10
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::full() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:96
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::from() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:168
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:201
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\JoinRule::reference() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/JoinRule.php:116
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\JoinRule::step() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/JoinRule.php:170
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\FactorRule::parens() packages/sql-semantics-mysql/src/Lowering/Query/Modern/FactorRule.php:75
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\PrimaryRule::specification() packages/sql-semantics-mysql/src/Lowering/Query/Modern/PrimaryRule.php:94
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ReferenceRule::reference() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ReferenceRule.php:80
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ReferenceRule::step() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ReferenceRule.php:122
- method-call SqlSemantics\Platform\MySql\Lowering\Query\QueryRules::tables() packages/sql-semantics-mysql/src/Lowering/Query/QueryRules.php:197