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

The words SQLite's tokenizer turns into keyword tokens.

Several words share a token: the join words are all JOIN_KW, and LIKE, GLOB and REGEXP are all LIKE_KW. Which keywords may fall back to identifiers is the grammar's business.

Methods§

public function __construct(private array<string, string> $keywords)

Parameters

$keywordsarray<string, string>Terminal name by upper-cased keyword
public static function load(string $path): self

Loads the table generated for one release.

Parameters

$pathstringKeyword resource file

Returns

self The table

Throws

RuntimeException When the file is missing or malformed
Test cases 2
Called from 1
Calls 3
public function lookup(string $word): string|null

Answers the terminal a word stands for, if it is a keyword.

Parameters

$wordstringWord as written

Returns

string|null Terminal name, or null for an identifier
Test cases 1
Calls 1

Private surface 1§

Implementation details, listed for orientation only.

private array<string, string> $keywords

Test cases 26§

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

Dedicated tests 3
Other tests reaching this symbol 23

Relations§

Static calls 1
Type declarations 2