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

Chooses which scanner owns the character under the cursor.

Holding the order in one place is what makes the lexer's dispatch a lookup rather than a decision: no scanner needs to know which others exist, and the grammar language can gain a lexeme by adding a scanner to the chain.

Methods§

public static function forBisonGrammar(): self

Builds the chain that reads GNU Bison and Yacc grammar files.

The claimed characters do not overlap, so the order is documentation rather than precedence.

Returns

self A chain covering every lexeme of the grammar language
Test cases 11
Called from 1
Calls 8
public function scannerFor(string $character): BisonScanner|null

Finds the scanner that recognises a lexeme starting at the character.

Parameters

$characterstringA single character; never the empty string

Returns

BisonScanner|null The first scanner that claims it, or null when none does
Test cases 12
Called from 1

Private surface 1§

Implementation details, listed for orientation only.

private list<BisonScanner> $scanners

Test cases 29§

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

Dedicated tests 13
Other tests reaching this symbol 16

Relations§

Static calls 1
Method calls 1
Type declarations 2