classSqliteLexer
final class SqliteLexer
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Reads SQLite text into the terminals of its grammar, as tokenize.c does.
SQLite hands the parser a semicolon at the end of the text when the last token was not one, so every input ends with a statement terminator.
Methods§
public function __construct(
private KeywordTable $keywords,
private array<string, true> $fallbacks = [],
private TriviaScanner $trivia = new \SqlParser\Sqlite\Lexer\TriviaScanner(),
private QuotedScanner $quoted = new \SqlParser\Sqlite\Lexer\QuotedScanner(),
private NumberScanner $numbers = new \SqlParser\Sqlite\Lexer\NumberScanner(),
private VariableScanner $variables = new \SqlParser\Sqlite\Lexer\VariableScanner(),
private WordScanner $words = new \SqlParser\Sqlite\Lexer\WordScanner(),
private OperatorScanner $operators = new \SqlParser\Sqlite\Lexer\OperatorScanner(),
)Parameters
$keywords | KeywordTable | Keywords of the release |
$fallbacks | array<string, true> | Keywords the grammar lets fall back to identifiers |
$trivia | TriviaScanner | Skips whitespace and comments |
$quoted | QuotedScanner | Reads quoted tokens |
$numbers | NumberScanner | Reads numbers |
$variables | VariableScanner | Reads parameters |
$words | WordScanner | Reads words |
$operators | OperatorScanner | Reads operators |
Calls 6
public function scan(string $sql): list<Lexeme>Reads SQL text into lexemes, a statement terminator last.
Parameters
$sql | string | The SQL text |
Returns
list<Lexeme> The lexemes in text orderThrows
LexicalException When the text holds something no token starts withTest cases 2
Called from 1
Calls 11
- new Scan line 54
- new Cursor line 54
- method-call TriviaScanner::skip() line 56
- method-call QuotedScanner::scan() line 60
- method-call NumberScanner::scan() line 61
- method-call VariableScanner::scan() line 62
- method-call WordScanner::scan() line 63
- method-call OperatorScanner::scan() line 64
- method-call Scan::last() line 66
- new Lexeme line 67
- function-call
strlenline 67
Private surface 8§
Implementation details, listed for orientation only.
private KeywordTable $keywordsprivate array<string, true> $fallbacks = []private TriviaScanner $trivia = new \SqlParser\Sqlite\Lexer\TriviaScanner()private QuotedScanner $quoted = new \SqlParser\Sqlite\Lexer\QuotedScanner()private NumberScanner $numbers = new \SqlParser\Sqlite\Lexer\NumberScanner()private VariableScanner $variables = new \SqlParser\Sqlite\Lexer\VariableScanner()private WordScanner $words = new \SqlParser\Sqlite\Lexer\WordScanner()private OperatorScanner $operators = new \SqlParser\Sqlite\Lexer\OperatorScanner()Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 1
SqliteParserTestcalls