classPostgreSqlLexer
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
$keywords | KeywordTable | Keywords of the release |
$trivia | TriviaScanner | Skips whitespace and comments |
$quoted | QuotedScanner | Reads quoted tokens |
$numbers | NumberScanner | Reads numbers and parameters |
$words | WordScanner | Reads words |
$operators | OperatorScanner | Reads operators and punctuation |
$lookahead | LookaheadFilter | Renames tokens by what follows them |
Calls 6
public function scan(string $sql): list<Lexeme>Reads SQL text into lexemes.
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 8
- new Scan line 49
- new Cursor line 49
- method-call TriviaScanner::skip() line 52
- method-call QuotedScanner::scan() line 56
- method-call NumberScanner::scan() line 57
- method-call WordScanner::scan() line 58
- method-call OperatorScanner::scan() line 59
- method-call LookaheadFilter::apply() line 62
Private surface 7§
Implementation details, listed for orientation only.
private KeywordTable $keywordsprivate 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
PostgreSqlParserTestcalls