classLiterals
final class Literals
Lowers constants and parameter markers.
Rule: PG-LITERAL-001. Scope: AexprConst, Iconst, Sconst, SignedIconst, NumericOnly, NumericOnly_list, I_or_F_const, file_name, generic_option_arg, and the PARAM, ICONST, FCONST, SCONST, BCONST and XCONST terminals. Constructors: Constant, BooleanLiteral, NullLiteral, TypedLiteral, PositionalParameter, NamedParameter, and the value classes they hold. Values are decoded by PG-LEX-STRING-001 and PG-LEX-NUMBER-001. A written plus sign before a number is dropped, as the grammar action drops it. An FCONST keeps its written text, which is the value the server stores. PostgreSQL 17 rejects a parameter number above 2147483647 while scanning. Source: https://www.postgresql.org/docs/17/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS, https://www.postgresql.org/docs/17/sql-expressions.html#SQL-EXPRESSIONS-PARAMETERS-POSITIONAL. Termination: lists are flattened iteratively. Status: Implemented.
Methods§
public function stringToken(Token $string): StringConstantLowers a string constant token.
Parameters
$string | Token |
Returns
Called from 1
Calls 3
- new StringConstant line 62
- method-call Strings::decode() line 62
- new Strings line 62
public function string(Node $string): StringConstantLowers Sconst, file_name or generic_option_arg.
Parameters
$string | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Literals::string() packages/sql-semantics-postgres/src/Lowering/Leaf/Literals.php:76
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Literals::constant() packages/sql-semantics-postgres/src/Lowering/Leaf/Literals.php:188
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Literals::constant() packages/sql-semantics-postgres/src/Lowering/Leaf/Literals.php:197
Calls 3
- method-call Literals::stringToken() line 75
- method-call Literals::string() line 76
- static-call ImplementationGap::production() line 77
public function numberToken(Token $number): NumericConstantLowers an FCONST token: the server keeps its written text as the value.
Parameters
$number | Token |
Returns
Called from 5
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Literals::number() packages/sql-semantics-postgres/src/Lowering/Leaf/Literals.php:115
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Literals::signed() packages/sql-semantics-postgres/src/Lowering/Leaf/Literals.php:131
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Literals::signed() packages/sql-semantics-postgres/src/Lowering/Leaf/Literals.php:132
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Literals::signed() packages/sql-semantics-postgres/src/Lowering/Leaf/Literals.php:133
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Literals::constant() packages/sql-semantics-postgres/src/Lowering/Leaf/Literals.php:187
Calls 1
public function integer(Node $integer): IntegerConstantLowers Iconst.
Parameters
$integer | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 5
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Literals::number() packages/sql-semantics-postgres/src/Lowering/Leaf/Literals.php:114
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Literals::signed() packages/sql-semantics-postgres/src/Lowering/Leaf/Literals.php:134
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Literals::signed() packages/sql-semantics-postgres/src/Lowering/Leaf/Literals.php:135
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Literals::signed() packages/sql-semantics-postgres/src/Lowering/Leaf/Literals.php:136
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Leaf\Literals::constant() packages/sql-semantics-postgres/src/Lowering/Leaf/Literals.php:186
Calls 4
- static-call ImplementationGap::production() line 98
- new IntegerConstant line 101
- method-call Numerals::decimal() line 101
- new Numerals line 101
public function number(Node $number): IntegerConstant|NumericConstantLowers I_or_F_const.
Parameters
$number | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalls 3
- method-call Literals::integer() line 114
- method-call Literals::numberToken() line 115
- static-call ImplementationGap::production() line 116
public function signed(Node $number): SignedNumberLowers SignedIconst or NumericOnly.
Parameters
$number | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 2
Calls 5
- method-call Literals::signed() line 130
- new SignedNumber line 131
- method-call Literals::numberToken() line 131
- method-call Literals::integer() line 134
- static-call ImplementationGap::production() line 137
public function signedList(Node $list): list<SignedNumber>Lowers NumericOnly_list.
Parameters
$list | Node |
Returns
list<SignedNumber>Calls 2
- method-call Lowering::items() line 149
- method-call Literals::signed() line 150
Lowers a PARAM token: $n, or :name under the named parameter style.
Parameters
$parameter | Token |
Returns
Throws
AnalysisException When the number is above 2147483647 in PostgreSQL 17, which the `param` rule of its scanner `scan.l` rejectsCalls 9
- function-call
str_starts_withline 163 - new NamedParameter line 164
- function-call
substrline 164 - new Numerals line 166
- method-call Numerals::canonical() line 167
- class-const GrammarRelease::PostgreSql166() line 168
- method-call Numerals::within() line 168
- new AnalysisException line 169
- new PositionalParameter line 172
Lowers AexprConst.
Parameters
$constant | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalls 14
- new Strings line 183
- new Constant line 186
- method-call Literals::integer() line 186
- method-call Literals::numberToken() line 187
- method-call Literals::string() line 188
- new BitStringConstant line 189
- class-const BitStringRadix::Binary() line 189
- method-call Strings::digits() line 189
- class-const BitStringRadix::Hexadecimal() line 190
- new BooleanLiteral line 191
- new NullLiteral line 193
- new TypedLiteral line 195
- function-call
countline 197 - static-call ImplementationGap::production() line 199
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
LiteralsTestcalls