final class LexicalException
    extends SourceException
Public API: explicitly declared with @visibility public.

The SQL text holds something no token of the dialect starts with.

Describing an unterminated stringdoctest
$e = \SqlParser\Lexer\LexicalException::unterminated('string', "SELECT 'abc", 7);
    $e->getMessage() // => 'Unterminated string at line 1, column 8'
    $e->offset // => 7

Methods§

public static function unterminated(string $construct, string $source, int $offset): self

Describes a construct that never closes.

Parameters

$constructstringWhat was opened
$sourcestringThe SQL text
$offsetintByte offset where it opened

Returns

self The exception
Test cases 2
Called from 12
Calls 2
public static function unexpectedCharacter(string $source, int $offset): self

Describes a character no token starts with.

Parameters

$sourcestringThe SQL text
$offsetintByte offset of the character

Returns

self The exception
Test cases 1
Called from 14
Calls 2
public static function unknownTerminal(string $name, string $source, int $offset): self

Describes a token the grammar of the selected release does not know.

Parameters

$namestringTerminal name the lexer produced
$sourcestringThe SQL text
$offsetintByte offset of the token

Returns

self The exception
Test cases 1
Called from 1
Calls 2

Test cases 39§

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

Dedicated tests 3
Other tests reaching this symbol 36

Relations§

Static calls 27