classParamDirectiveReader
final class ParamDirectiveReader
implements BisonDirectiveReader
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Reads %parse-param and %lex-param, which add arguments to the generated
parser and scanner.
The argument is host-language code in braces, so it arrives as one action token rather than as a sequence of symbols.
Methods§
public function handles(string $directive): boolReports whether the directive declares an extra parser or scanner argument.
Parameters
$directive | string | Directive name including its percent sign |
Returns
bool True for "%parse-param" and "%lex-param"Test cases 1
ParamDirectiveReaderTest::testHandlesClaimsBothParameterDirectivescovers and calls
public function read(BisonTokenStream $stream, string $directive): BisonDeclaration|nullConsumes the braced argument declaration.
Parameters
$stream | BisonTokenStream | Stream positioned just after the directive name |
$directive | string | Directive name including its percent sign |
Returns
BisonDeclaration|null The declaration, or null when no braced code followsTest cases 3
Calls 4
- method-call BisonTokenStream::nextIf() line 48
- class-const BisonLexeme::Action() line 48
- function-call
substrline 54 - new BisonParamDeclaration line 56
Test cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
ParamDirectiveReaderTest::testHandlesClaimsBothParameterDirectivescovers and callsParamDirectiveReaderTest::testReadDeclaresNothingWhenNoBracedCodeFollowscovers and callsParamDirectiveReaderTest::testReadDistinguishesTheScannerDirectivecovers and callsParamDirectiveReaderTest::testReadTakesTheBracedArgumentAndTheDirectiveKindcovers and calls