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

Maps PostgreSQL tokens to comparison keys for the token correspondence check.

Rule: PG-LEAF-KEY-001. An identifier, and a keyword read through one of the keyword-category nonterminals, is keyed by its decoded name. A string constant is keyed by its decoded value, a bit string by its notation and digits, an integer constant by its value, a numeric constant (FCONST) by its exact text, which the server keeps as the value (PG-LEX-NUMBER-001), a parameter by its canonical marker, an operator by its text. Every other token is keyed by its terminal; the lookahead variants the parser's token filter introduces (NOT_LA, WITH_LA, WITHOUT_LA, NULLS_LA, FORMAT_LA) are the same word as their base keyword and share its key. The noise positions are the union of the family tables. Status: Implemented.

Methods§

public function key(Token $token, string $signature, int $position): ?string

Answers the comparison key of a token, or null when the token is declared noise.

Parameters

$tokenToken
$signaturestring
$positionint

Returns

?string
Test cases 5
Calls 16
public function noise(): array<string, list<int>>

Private surface 2§

Implementation details, listed for orientation only.

private const LOOKAHEAD = ['NOT_LA' => 'NOT', 'WITH_LA' => 'WITH', 'WITHOUT_LA' => 'WITHOUT', 'NULLS_LA' …
private static array<string, list<int>>|null $noise = null

Test cases 6§

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

Dedicated tests 6

Relations§

Instantiated in 1
Type declarations 1