classNameRule
final class NameRule
Lowers identifier tokens and name lists into decoded names.
Rule: SQLITE-NAME-001. Scope: nm, dbnm, fullname, idlist, idlist_opt, collate and the identifier token classes. A name is decoded by SQLITE-IDENTIFIER-DECODE-001 and recorded as an operand leaf; in nm dbnm the first name is the schema when the second is present. Terminates: lists are flattened iteratively. Source: https://sqlite.org/lang_keywords.html, https://sqlite.org/lang_naming.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
Lowers a name position.
Parameters
$name | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 6
- method-call SqlSemantics\Platform\Sqlite\Lowering\Leaf\NameRule::scoped() packages/sql-semantics-sqlite/src/Lowering/Leaf/NameRule.php:67
- method-call SqlSemantics\Platform\Sqlite\Lowering\Leaf\NameRule::scoped() packages/sql-semantics-sqlite/src/Lowering/Leaf/NameRule.php:72
- method-call SqlSemantics\Platform\Sqlite\Lowering\Leaf\NameRule::qualified() packages/sql-semantics-sqlite/src/Lowering/Leaf/NameRule.php:87
- method-call SqlSemantics\Platform\Sqlite\Lowering\Leaf\NameRule::pair() packages/sql-semantics-sqlite/src/Lowering/Leaf/NameRule.php:98
- method-call SqlSemantics\Platform\Sqlite\Lowering\Leaf\NameRule::pair() packages/sql-semantics-sqlite/src/Lowering/Leaf/NameRule.php:100
- method-call SqlSemantics\Platform\Sqlite\Lowering\Leaf\NameRule::list() packages/sql-semantics-sqlite/src/Lowering/Leaf/NameRule.php:118
Calls 2
- method-call NameRule::token() line 47
- static-call ImplementationGap::production() line 48
Decodes one identifier token and records the name as an operand leaf.
Parameters
$token | Token |
Returns
Called from 2
Calls 3
- new Name line 57
- method-call Identifiers::decode() line 57
- new Identifiers line 57
public function scoped(Node $name, Node $second): QualifiedNameLowers nm dbnm: a name that the optional second name turns into its schema.
Returns
Throws
ImplementationGap When the production has no ruleCalls 3
- method-call NameRule::name() line 67
- new QualifiedName line 71
- static-call ImplementationGap::production() line 73
public function qualified(Node $fullname): QualifiedNameLowers a fullname: a name with its optional schema.
Parameters
$fullname | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalls 4
- new QualifiedName line 87
- method-call NameRule::name() line 87
- method-call NameRule::pair() line 88
- static-call ImplementationGap::production() line 89
public function pair(Node $schema, Node $name): QualifiedNameLowers a schema name and an object name written around a dot.
Returns
Called from 1
Calls 2
- method-call NameRule::name() line 98
- new QualifiedName line 100
Lowers an idlist into its names in written order.
Parameters
$idlist | Node |
Returns
list<Name>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 4
- static-call ImplementationGap::production() line 114
- method-call Lists::items() line 117
- new Lists line 117
- method-call NameRule::name() line 118
Lowers an idlist_opt: the names in written order, or null when the list is absent.
Parameters
$list | Node |
Returns
list<Name>|nullThrows
ImplementationGap When the production has no ruleCalls 2
- method-call NameRule::list() line 136
- static-call ImplementationGap::production() line 137
Lowers a collate: the collation name, or null when none is written.
Parameters
$collate | Node |
Returns
?NameThrows
ImplementationGap When the production has no ruleCalls 2
- method-call NameRule::token() line 152
- static-call ImplementationGap::production() line 153
Private surface 1§
Implementation details, listed for orientation only.
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
NameRuleTestcalls