classStartDirectiveReader
final class StartDirectiveReader
implements BisonDirectiveReader
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Reads %start, which names the rule a derivation begins from.
Methods§
public function handles(string $directive): boolReports whether the directive is %start.
Parameters
$directive | string | Directive name including its percent sign |
Returns
bool True for "%start"Test cases 1
StartDirectiveReaderTest::testHandlesClaimsOnlyTheStartDirectivecovers and calls
public function read(BisonTokenStream $stream, string $directive): BisonDeclaration|nullConsumes the rule name.
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 rule name followsTest cases 3
StartDirectiveReaderTest::testReadDeclaresNothingWhenNoRuleNameFollowscovers and callsStartDirectiveReaderTest::testReadLeavesATokenItDidNotClaimcovers and callsStartDirectiveReaderTest::testReadTakesTheRuleNamecovers and calls
Calls 3
- method-call BisonTokenStream::nextIf() line 46
- class-const BisonLexeme::Identifier() line 46
- new BisonStartDeclaration 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
StartDirectiveReaderTest::testHandlesClaimsOnlyTheStartDirectivecovers and callsStartDirectiveReaderTest::testReadDeclaresNothingWhenNoRuleNameFollowscovers and callsStartDirectiveReaderTest::testReadLeavesATokenItDidNotClaimcovers and callsStartDirectiveReaderTest::testReadTakesTheRuleNamecovers and calls