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

Reads %type, which gives rules the semantic type their values carry.

The type tag is what the directive exists for, so a %type without one declares nothing and is reported as absent rather than as an empty list.

Methods§

public function handles(string $directive): bool

Reports whether the directive is %type.

Parameters

$directivestringDirective name including its percent sign

Returns

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

Consumes the type tag and the rule names it applies to.

Parameters

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

Returns

BisonDeclaration|null The declaration, or null when no type tag follows
Test cases 4
Calls 7

Private surface 1§

Implementation details, listed for orientation only.

private BisonDeclarationBoundary $boundary

Test cases 9§

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

Dedicated tests 5
Other tests reaching this symbol 4

Relations§

Instantiated in 1