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

Consumes a decimal number.

Numbers appear in a grammar as explicit token codes and as the counts of %expect, so the value is carried as an integer rather than as the digits that spelled it.

Methods§

public function handles(string $character): bool

Reports whether a number can start here.

Parameters

$characterstringA single character; never the empty string

Returns

bool True for a decimal digit
Test cases 1
Calls 1
public function scan(SourceCursor $cursor): BisonToken

Consumes the run of digits.

Parameters

$cursorSourceCursorCursor positioned on the first digit

Returns

BisonToken The number as an integer value
Test cases 3
Calls 5

Test cases 22§

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 18

Relations§

Instantiated in 1