classExpectDirectiveReader
final class ExpectDirectiveReader
implements BisonDirectiveReader
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Reads %expect, the count of shift/reduce conflicts the author accepts.
Methods§
public function handles(string $directive): boolReports whether the directive is %expect.
Parameters
$directive | string | Directive name including its percent sign |
Returns
bool True for "%expect"Test cases 1
ExpectDirectiveReaderTest::testHandlesClaimsOnlyTheExpectDirectivecovers and calls
public function read(BisonTokenStream $stream, string $directive): BisonDeclaration|nullConsumes the conflict count.
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 number followsTest cases 3
ExpectDirectiveReaderTest::testReadDeclaresNothingWhenNoNumberFollowscovers and callsExpectDirectiveReaderTest::testReadLeavesATokenItDidNotClaimcovers and callsExpectDirectiveReaderTest::testReadTakesTheConflictCountcovers and calls
Calls 3
- method-call BisonTokenStream::nextIf() line 46
- class-const BisonLexeme::Number() line 46
- new BisonExpectDeclaration line 48
Test cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
ExpectDirectiveReaderTest::testHandlesClaimsOnlyTheExpectDirectivecovers and callsExpectDirectiveReaderTest::testReadDeclaresNothingWhenNoNumberFollowscovers and callsExpectDirectiveReaderTest::testReadLeavesATokenItDidNotClaimcovers and callsExpectDirectiveReaderTest::testReadTakesTheConflictCountcovers and calls