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

Reads what follows @ in MySQL: a user variable, a host name or a system variable.

After one @ the next word is a host name, so that user@localhost reads as a whole. After @@ the next word is a keyword or identifier naming a system variable, possibly qualified with global. or session..

Methods§

public function at(Scan $scan): Lexeme

Reads the @ at the cursor and decides how the next token is read.

Parameters

$scanScanThe tokenization in progress, positioned on the at sign

Returns

Lexeme The lexeme for `@`
Test cases 1
Called from 1
Calls 4
public function hostname(Scan $scan): Lexeme

Reads the host name after @, which may be empty.

Parameters

$scanScanThe tokenization in progress

Returns

Lexeme The LEX_HOSTNAME lexeme
Test cases 1
Called from 1
Calls 2
public function systemVariable(Scan $scan): Lexeme

Reads the second @ of a system variable reference.

Parameters

$scanScanThe tokenization in progress, positioned on the second at sign

Returns

Lexeme The lexeme for `@`
Test cases 1
Called from 1
Calls 3
public function identifierOrKeyword(Scan $scan, WordScanner $words): Lexeme

Reads the name after @@, as a keyword when it is one.

Parameters

$scanScanThe tokenization in progress
$wordsWordScannerReads the identifier bytes

Returns

Lexeme The lexeme

Throws

LexicalException When no name follows
Test cases 2
Called from 1
Calls 6

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 4
Type declarations 1