classExpect
final class Expect
implements Declaration
Public API: explicitly declared with
@visibility public.An %expect or %expect-rr directive declaring how many conflicts the grammar has.
$file = (new \BisonParser\Parser())->parse("%expect 59\n%%\ns: 'a';\n");
$file->declarations[0]->count // => 59
$file->declarations[0]->reduceReduce // => falseProperties§
public int $countpublic bool $reduceReducepublic Location $locationMethods§
public function __construct(
public int $count,
public bool $reduceReduce,
public Location $location,
)Parameters
$count | int | The declared number of conflicts |
$reduceReduce | bool | Whether the directive is `%expect-rr` rather than `%expect` |
$location | Location | Where the directive is written |
public function location(): LocationAnswers where the declaration begins.
Returns
Location Line and column of the percent signTest cases 1
ExpectTest::testLocationcalls
Test cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ExpectTest::testLocationcalls