classKeywordTable
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
$keywords | array<string, string> | Terminal name by upper-cased keyword |
public static function load(string $path): selfLoads the table generated for one release.
Parameters
$path | string | Keyword resource file |
Returns
self The tableThrows
RuntimeException When the file is missing or malformedTest cases 2
Called from 1
public function lookup(string $word): string|nullAnswers the terminal a word stands for, if it is a keyword.
Parameters
$word | string | Word as written |
Returns
string|null Terminal name, or null for an identifierTest cases 1
Calls 1
- function-call
strtoupperline 56
Private surface 1§
Implementation details, listed for orientation only.
private array<string, string> $keywordsTest 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
NumberScannerTest::testScancallsNumberScannerTest::testScanRejectsTrailingJunkcallsOperatorScannerTest::testScancallsOperatorScannerTest::testScanRejectsAForeignCharactercallsQuotedScannerTest::testScancallsQuotedScannerTest::testScanRejectsAnOddBlobcallsQuotedScannerTest::testScanRejectsAnUnterminatedBracketcallsQuotedScannerTest::testScanRejectsAnUnterminatedStringcallsScanTest::testLastcallsScanTest::testLexemecallsSqliteLexerTest::testScanEndsWithAStatementTerminatorcallsSqliteLexerTest::testScanRejectsAnUnreadableCharactercallsTriviaScannerTest::testSkipcallsTriviaScannerTest::testSkipLeavesASlashBeforeTheEndAlonecallsTriviaScannerTest::testSkipRunsAnUnterminatedCommentToTheEndcallsVariableScannerTest::testScancallsVariableScannerTest::testScanRejectsAnUnterminatedSuffixcallsVariableScannerTest::testScanRejectsASigilWithoutANamecallsWordScannerTest::testAheadcallsWordScannerTest::testContextualcallsWordScannerTest::testProbecallsWordScannerTest::testScancallsSqliteParserTestcalls