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

Turns a terminal's spellings into a lookup from spelling to terminal.

Lexical declarations list, for each terminal, every word that spells it. Both directions are needed: realization picks a spelling for a terminal, and tokenizing recognises a terminal from the spelling it met. Deriving the second from the first keeps the profile a single statement of the mapping.

Methods§

public function reversed(array<string, list<string>> $keywords): array<string, string>

Inverts a terminal-to-spellings map.

Spellings are upper-cased because SQL keywords are matched without regard to case, so the index is keyed the way a tokenizer will ask.

Parameters

$keywordsarray<string, list<string>>Spellings by terminal name

Returns

array<string, string> Terminal name by upper-cased spelling
Test cases 4
Calls 1

Test cases 9§

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

Dedicated tests 4
Other tests reaching this symbol 5

Relations§

Instantiated in 1
Type declarations 1