classOperatorScanner
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§
Reads the operator at the cursor, if one starts there.
Parameters
$scan | Scan | The tokenization in progress |
Returns
Lexeme The lexemeThrows
LexicalException When the character starts no token at allTest cases 3
Called from 1
Calls 9
- static-call Scan::isIdentifierByte() line 43
- static-call LexicalException::unexpectedCharacter() line 44
- method-call Scan::lexeme() line 47
- function-call
substrline 50 - function-call
strlenline 51 - method-call OperatorScanner::multiCharacter() line 51
- method-call OperatorScanner::separator() line 58
- function-call
str_containsline 60 - class-const OperatorScanner::SINGLE() line 60
public function multiCharacter(Scan $scan, string $candidate): string|nullReads 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
$scan | Scan | The tokenization in progress, positioned on the dot |
Returns
Lexeme The lexemeTest cases 1
Called from 2
Calls 4
- static-call Scan::isIdentifierByte() line 106
- class-const LexerState::IdentifierStart() line 106
- class-const LexerState::Start() line 106
- method-call Scan::lexeme() line 108
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
MySqlLexerTestcallsMySqlParserTestcalls