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

Reads MySQL's operators, punctuation and parameter markers.

Comparison operators take the longest spelling the keyword table knows, && and || are the boolean operators, := assigns, and -> and ->> are the JSON operators of releases that have them. Every other punctuation character is a token of its own.

Constants§

public const SINGLE = '()[],;+-*/%^~{}:=<>!&|.'

Characters that are tokens of their own.

Methods§

public function scan(Scan $scan): Lexeme

Reads the operator at the cursor, if one starts there.

Parameters

$scanScanThe tokenization in progress

Returns

Lexeme The lexeme

Throws

LexicalException When the character starts no token at all
Test cases 3
Called from 1
Calls 9
public function multiCharacter(Scan $scan, string $candidate): string|null

Names the terminal a two- or three-character operator stands for.

Parameters

$scanScanThe tokenization in progress
$candidatestringThe characters at the cursor

Returns

string|null Terminal name, or null when they are not one operator
Test cases 1
Called from 1
Calls 1
public function separator(Scan $scan): Lexeme

Reads the . that separates the parts of a qualified name.

The word after it is read as an identifier whatever it spells, when one follows at once.

Parameters

$scanScanThe tokenization in progress, positioned on the dot

Returns

Lexeme The lexeme
Test cases 1
Called from 2
Calls 4

Test cases 7§

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 2

Relations§

Instantiated in 1
Method calls 2
Type declarations 1