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

Reads %token, which names the terminals the scanner may hand the parser.

Each terminal is a name that may be followed by an explicit token code and by a quoted alias, in that order and both optional, so the entries have to be read one at a time rather than collected as a flat list of names.

Methods§

public function handles(string $directive): bool

Reports whether the directive is %token.

Parameters

$directivestringDirective name including its percent sign

Returns

bool True for "%token"
Test cases 1
public function read(BisonTokenStream $stream, string $directive): BisonDeclaration

Consumes the optional type tag and every terminal that follows it.

Parameters

$streamBisonTokenStreamStream positioned just after the directive name
$directivestringDirective name including its percent sign

Returns

BisonDeclaration The declaration, with no terminals when none followed
Test cases 5
Calls 8

Private surface 1§

Implementation details, listed for orientation only.

private BisonDeclarationBoundary $boundary

Test cases 14§

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

Dedicated tests 10
Other tests reaching this symbol 4

Relations§

Instantiated in 1