classNames
final class Names
Lowers identifiers and the name forms built from them.
Rule: PG-NAME-001. Scope: ColId, ColLabel, BareColLabel, type_function_name, NonReservedWord, name, attr_name, param_name, columnElem, generic_option_name, name_list, opt_name_list, columnList, opt_column_list, qualified_name, qualified_name_list, any_name, any_name_list, attrs, func_name, opt_single_name, opt_qualified_name, opt_collate, opt_collate_clause. Constructors: Name, QualifiedName, DottedName. An identifier is decoded by PG-IDENT-001, a keyword by PG-KEYWORD-NAME-001. A relation name and a function name written with an indirection accept field selections only and a relation name at most three parts; the server rejects anything else while parsing, so it is SQL outside the grammar. Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS. Status: Implemented.
Methods§
Lowers a single name: ColId, ColLabel, BareColLabel, type_function_name, NonReservedWord, name, attr_name, param_name, columnElem or generic_option_name.
Parameters
$name | Node |
Returns
Called from 8
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Names::names() packages/sql-semantics-postgres/src/Lowering/Leaf/Names.php:117
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Names::attributes() packages/sql-semantics-postgres/src/Lowering/Leaf/Names.php:133
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Names::dotted() packages/sql-semantics-postgres/src/Lowering/Leaf/Names.php:166
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Names::dotted() packages/sql-semantics-postgres/src/Lowering/Leaf/Names.php:167
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Names::dotted() packages/sql-semantics-postgres/src/Lowering/Leaf/Names.php:168
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Names::qualified() packages/sql-semantics-postgres/src/Lowering/Leaf/Names.php:198
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Names::qualified() packages/sql-semantics-postgres/src/Lowering/Leaf/Names.php:199
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Names::optional() packages/sql-semantics-postgres/src/Lowering/Leaf/Names.php:232
Calls 2
- new Name line 62
- method-call Names::text() line 62
Lowers an identifier token.
Parameters
$identifier | Token |
Returns
Calls 3
- new Name line 70
- method-call Identifiers::decode() line 70
- new Identifiers line 70
public function text(Node $name): stringReads the decoded text of a single name without creating an operand, for rules that decide by the word.
Parameters
$name | Node |
Returns
stringThrows
ImplementationGap When the production has no ruleCalled from 1
Calls 6
- class-const Names::FORMS() line 83
- static-call ImplementationGap::production() line 83
- method-call Identifiers::decode() line 85
- new Identifiers line 85
- method-call Keywords::word() line 88
- new Keywords line 88
Lowers a name list: name_list, opt_name_list, columnList or opt_column_list; an absent optional list is empty.
Parameters
$list | Node |
Returns
list<Name>Throws
ImplementationGap When the production has no ruleCalls 3
- static-call ImplementationGap::production() line 114
- method-call Lowering::items() line 116
- method-call Names::name() line 117
Lowers attrs: the names after the dots.
Parameters
$attributes | Node |
Returns
list<Name>Called from 1
Calls 2
- method-call Lowering::items() line 132
- method-call Names::name() line 133
Lowers an indirection that the grammar action accepts as field selections only.
Parameters
$indirection | Node |
Returns
list<Name>Throws
AnalysisException When the indirection holds a subscript, a slice or a star, which `check_qualified_name` and `check_func_name` of `gram.y` reject in a nameCalled from 2
Calls 1
public function dotted(Node $name): DottedNameLowers any_name or func_name.
Parameters
$name | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Names::dottedList() packages/sql-semantics-postgres/src/Lowering/Leaf/Names.php:182
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Names::optionalDotted() packages/sql-semantics-postgres/src/Lowering/Leaf/Names.php:248
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Names::optionalDotted() packages/sql-semantics-postgres/src/Lowering/Leaf/Names.php:249
Calls 5
- new DottedName line 165
- method-call Names::name() line 166
- method-call Names::attributes() line 167
- method-call Names::fields() line 168
- static-call ImplementationGap::production() line 169
public function dottedList(Node $list): list<DottedName>Lowers any_name_list.
Parameters
$list | Node |
Returns
list<DottedName>Calls 2
- method-call Lowering::items() line 181
- method-call Names::dotted() line 182
public function qualified(Node $name): QualifiedNameLowers qualified_name: a relation name of one to three parts.
Parameters
$name | Node |
Returns
Throws
AnalysisException When the name has more than three parts, which `makeRangeVarFromQualifiedName` of `gram.y` rejectsImplementationGap When the production has no ruleCalled from 1
Calls 6
- method-call Names::name() line 198
- method-call Names::fields() line 199
- static-call ImplementationGap::production() line 200
- method-call DottedName::qualified() line 203
- new DottedName line 203
- new AnalysisException line 203
public function qualifiedList(Node $list): list<QualifiedName>Lowers qualified_name_list.
Parameters
$list | Node |
Returns
list<QualifiedName>Calls 2
- method-call Lowering::items() line 214
- method-call Names::qualified() line 215
Lowers opt_single_name: a name or nothing.
Parameters
$name | Node |
Returns
?NameThrows
ImplementationGap When the production has no ruleCalls 2
- method-call Names::name() line 232
- static-call ImplementationGap::production() line 233
public function optionalDotted(Node $name): ?DottedNameLowers opt_qualified_name, opt_collate or opt_collate_clause: a dotted name or nothing.
Parameters
$name | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalls 2
- method-call Names::dotted() line 248
- static-call ImplementationGap::production() line 250
Private surface 2§
Implementation details, listed for orientation only.
private const FORMS = ['ColId: IDENT' => 0, 'ColId: unreserved_keyword' => 1, 'ColId: col_name_keywor…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
NamesTestcalls