final class Literals
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.

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 __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe hub
public function number(Node $number): IntegerConstant|NumericConstant

Lowers I_or_F_const.

Parameters

$numberNode

Throws

ImplementationGap When the production has no rule
Calls 3
public function signedList(Node $list): list<SignedNumber>

Lowers NumericOnly_list.

Parameters

$listNode

Returns

Calls 2
public function parameter(Token $parameter): Scalar

Lowers a PARAM token: $n, or :name under the named parameter style.

Parameters

$parameterToken

Returns

Throws

AnalysisException When the number is above 2147483647 in PostgreSQL 17, which the `param` rule of its scanner `scan.l` rejects
Calls 9
public function constant(Node $constant): Scalar

Private surface 1§

Implementation details, listed for orientation only.

private Lowering $lowering

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 1
Type declarations 1