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

Reads PostgreSQL text into the terminals of its grammar, as scan.l and parser.c do.

Methods§

public function __construct(
    private KeywordTable $keywords,
    private TriviaScanner $trivia = new \SqlParser\PostgreSql\Lexer\TriviaScanner(),
    private QuotedScanner $quoted = new \SqlParser\PostgreSql\Lexer\QuotedScanner(),
    private NumberScanner $numbers = new \SqlParser\PostgreSql\Lexer\NumberScanner(),
    private WordScanner $words = new \SqlParser\PostgreSql\Lexer\WordScanner(),
    private OperatorScanner $operators = new \SqlParser\PostgreSql\Lexer\OperatorScanner(),
    private LookaheadFilter $lookahead = new \SqlParser\PostgreSql\Lexer\LookaheadFilter(),
)

Parameters

$keywordsKeywordTableKeywords of the release
$triviaTriviaScannerSkips whitespace and comments
$quotedQuotedScannerReads quoted tokens
$numbersNumberScannerReads numbers and parameters
$wordsWordScannerReads words
$operatorsOperatorScannerReads operators and punctuation
$lookaheadLookaheadFilterRenames tokens by what follows them
Calls 6
public function scan(string $sql): list<Lexeme>

Reads SQL text into lexemes.

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 8

Private surface 7§

Implementation details, listed for orientation only.

private KeywordTable $keywords
private TriviaScanner $trivia = new \SqlParser\PostgreSql\Lexer\TriviaScanner()
private QuotedScanner $quoted = new \SqlParser\PostgreSql\Lexer\QuotedScanner()
private NumberScanner $numbers = new \SqlParser\PostgreSql\Lexer\NumberScanner()
private WordScanner $words = new \SqlParser\PostgreSql\Lexer\WordScanner()
private OperatorScanner $operators = new \SqlParser\PostgreSql\Lexer\OperatorScanner()
private LookaheadFilter $lookahead = new \SqlParser\PostgreSql\Lexer\LookaheadFilter()

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