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(),
private ParameterSyntax $parameters = ParameterSyntax::Native,
)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 |
$parameters | ParameterSyntax | Which parameter markers are read |
Calls 7
- new TriviaScanner line 31
- new QuotedScanner line 32
- new NumberScanner line 33
- new WordScanner line 34
- new OperatorScanner line 35
- new LookaheadFilter line 36
- class-const ParameterSyntax::Native() line 37
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 52
- new Cursor line 52
- method-call TriviaScanner::skip() line 55
- method-call QuotedScanner::scan() line 59
- method-call NumberScanner::scan() line 60
- method-call WordScanner::scan() line 61
- method-call OperatorScanner::scan() line 62
- method-call LookaheadFilter::apply() line 65
Private surface 8§
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()private ParameterSyntax $parameters = ParameterSyntax::NativeTest 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