final class SqlTokenScanner

Reads a statement into the lexemes it is written as, losing nothing.

Every byte of the statement ends up in exactly one token, whitespace and comments included, so that the statement can always be written back out unchanged. Nothing here knows any SQL: which quotes open a string, what begins a comment and what may spell an identifier are all asked of the profile, so one reader serves every dialect.

What each kind of lexeme is spelled like is a reader of its own; this one asks each in turn and keeps the depths, because only a statement read as a whole can say how deeply a lexeme is nested.

Methods§

public function __construct(
    private SqlTriviaReader $trivia = new \ZtdQuery\Sql\Reader\SqlTriviaReader(),
    private SqlDelimitedReader $delimited = new \ZtdQuery\Sql\Reader\SqlDelimitedReader(),
    private SqlParameterReader $parameters = new \ZtdQuery\Sql\Reader\SqlParameterReader(),
    private SqlWordReader $words = new \ZtdQuery\Sql\Reader\SqlWordReader(),
)

Private surface 4§

Implementation details, listed for orientation only.

private SqlTriviaReader $trivia = new \ZtdQuery\Sql\Reader\SqlTriviaReader()
private SqlDelimitedReader $delimited = new \ZtdQuery\Sql\Reader\SqlDelimitedReader()
private SqlParameterReader $parameters = new \ZtdQuery\Sql\Reader\SqlParameterReader()
private SqlWordReader $words = new \ZtdQuery\Sql\Reader\SqlWordReader()

Test cases 8§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 5
Other tests reaching this symbol 3

Relations§

Instantiated in 1
Method calls 1