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

Reads %define, which sets a named option of the generated parser.

The value is optional: %define api.pure is a flag, while %define api.prefix "yy" carries a setting. A name on its own is therefore not an error, and the value is only taken when something that can be one follows.

Methods§

public function handles(string $directive): bool

Reports whether the directive is %define.

Parameters

$directivestringDirective name including its percent sign

Returns

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

Consumes the option name and, when present, its value.

Parameters

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

Returns

BisonDeclaration|null The declaration, or null when no option name follows
Test cases 5
Calls 5

Test cases 10§

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

Dedicated tests 6
Other tests reaching this symbol 4

Relations§

Instantiated in 1