classVariableScanner
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§
Reads the @ at the cursor and decides how the next token is read.
Parameters
$scan | Scan | The tokenization in progress, positioned on the at sign |
Returns
Lexeme The lexeme for `@`Test cases 1
Called from 1
Calls 4
- class-const LexerState::SystemVariable() line 35
- class-const LexerState::Start() line 36
- class-const LexerState::Hostname() line 37
- method-call Scan::lexeme() line 40
Reads the host name after @, which may be empty.
Parameters
$scan | Scan | The tokenization in progress |
Returns
Lexeme The LEX_HOSTNAME lexemeTest cases 1
Called from 1
Calls 2
- class-const LexerState::Start() line 55
- method-call Scan::lexeme() line 57
Reads the second @ of a system variable reference.
Parameters
$scan | Scan | The tokenization in progress, positioned on the second at sign |
Returns
Lexeme The lexeme for `@`Test cases 1
Called from 1
Calls 3
- class-const LexerState::Start() line 72
- class-const LexerState::IdentifierOrKeyword() line 72
- method-call Scan::lexeme() line 74
public function identifierOrKeyword(Scan $scan, WordScanner $words): LexemeReads the name after @@, as a keyword when it is one.
Parameters
$scan | Scan | The tokenization in progress |
$words | WordScanner | Reads the identifier bytes |
Returns
Lexeme The lexemeThrows
LexicalException When no name followsTest cases 2
Called from 1
Calls 6
- method-call WordScanner::consume() line 91
- static-call LexicalException::unexpectedCharacter() line 93
- class-const LexerState::IdentifierSeparator() line 95
- class-const LexerState::Start() line 95
- method-call WordScanner::identifierLexeme() line 98
- method-call Scan::lexeme() line 98
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
Relations§
Instantiated in 1
Method calls 4
- method-call SqlParser\MySql\Lexer\MySqlLexer::next() packages/sql-parser/src/MySql/Lexer/MySqlLexer.php:91
- method-call SqlParser\MySql\Lexer\MySqlLexer::next() packages/sql-parser/src/MySql/Lexer/MySqlLexer.php:92
- method-call SqlParser\MySql\Lexer\MySqlLexer::next() packages/sql-parser/src/MySql/Lexer/MySqlLexer.php:93
- method-call SqlParser\MySql\Lexer\MySqlLexer::next() packages/sql-parser/src/MySql/Lexer/MySqlLexer.php:97