final class ExpectItem
    implements RhsItem
Public API: explicitly declared with @visibility public.

An %expect or %expect-rr modifier declaring the conflicts of one alternative.

Reading a per-rule expectationdoctest
$file = (new \BisonParser\Parser())->parse("%%\ns: 'a' %expect 1 ;\n");
    $file->rules()[0]->alternatives[0]->items[1]->count // => 1

Properties§

public int $count
public bool $reduceReduce
public Location $location

Methods§

public function __construct(
    public int $count,
    public bool $reduceReduce,
    public Location $location,
)

Parameters

$countintThe declared number of conflicts
$reduceReduceboolWhether the modifier is `%expect-rr` rather than `%expect`
$locationLocationWhere the modifier is written
public function location(): Location

Answers where the item begins.

Returns

Location Line and column of the modifier
Test cases 1

Test cases 6§

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

Dedicated tests 1
Other tests reaching this symbol 5

Relations§

Instantiated in 1
Constant reads 1