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

Consumes a symbol name.

Rule names and token names share one spelling in Bison: which of the two a name refers to is decided by the parser from where it appears, not by the lexer. Digits and dots may follow the first character but may not open the name, which is what keeps a number from being read as an identifier.

Methods§

public function handles(string $character): bool

Reports whether a symbol name can start here.

Parameters

$characterstringA single character; never the empty string

Returns

bool True for a letter or an underscore
Test cases 2
Calls 1
public function scan(SourceCursor $cursor): BisonToken

Consumes the name.

Parameters

$cursorSourceCursorCursor positioned on the first character

Returns

BisonToken The symbol name
Test cases 2
Calls 5

Test cases 23§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 4
Other tests reaching this symbol 19

Relations§

Instantiated in 1