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

$keywordsKeywordTableKeywords of the release
$fallbacksarray<string, true>Keywords the grammar lets fall back to identifiers
$triviaTriviaScannerSkips whitespace and comments
$quotedQuotedScannerReads quoted tokens
$numbersNumberScannerReads numbers
$variablesVariableScannerReads parameters
$wordsWordScannerReads words
$operatorsOperatorScannerReads operators
Calls 6
public function scan(string $sql): list<Lexeme>

Reads SQL text into lexemes, a statement terminator last.

Parameters

$sqlstringThe SQL text

Returns

list<Lexeme> The lexemes in text order

Throws

LexicalException When the text holds something no token starts with
Test cases 2
Called from 1
Calls 11

Private surface 8§

Implementation details, listed for orientation only.

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()

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

Relations§

Instantiated in 1
Method calls 1
Type declarations 1