interfaceBisonScanner
interface BisonScanner
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
One state of the Bison lexer, selected by the character it starts on.
The lexer holds no rule of its own: it asks the chain which scanner claims the character under the cursor and hands the cursor over. Whitespace and comments are already gone by the time a scanner is consulted, so a scanner that claims a character always produces a token from it.
Methods§
public function handles(string $character): boolReports whether this scanner recognises a lexeme starting at the character.
Parameters
$character | string | A single character; never the empty string |
Returns
bool True when this scanner should consume the lexemepublic function scan(SourceCursor $cursor): BisonTokenConsumes one lexeme, leaving the cursor after it.
Parameters
$cursor | SourceCursor | Cursor positioned on the character this scanner claimed |
Returns
BisonToken The recognised tokenTest cases 1
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Relations§
Implemented by 7
- ActionScanner packages/sql-faker/src/Compiler/Bison/Lexer/ActionScanner.php:21
- DirectiveScanner packages/sql-faker/src/Compiler/Bison/Lexer/DirectiveScanner.php:20
- IdentifierScanner packages/sql-faker/src/Compiler/Bison/Lexer/IdentifierScanner.php:19
- NumberScanner packages/sql-faker/src/Compiler/Bison/Lexer/NumberScanner.php:18
- PunctuationScanner packages/sql-faker/src/Compiler/Bison/Lexer/PunctuationScanner.php:20
- QuotedLiteralScanner packages/sql-faker/src/Compiler/Bison/Lexer/QuotedLiteralScanner.php:18
- TypeTagScanner packages/sql-faker/src/Compiler/Bison/Lexer/TypeTagScanner.php:20