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

A %dprec modifier ranking the alternative among GLR ambiguities.

Reading a dynamic precedencedoctest
$file = (new \BisonParser\Parser())->parse("%glr-parser\n%%\ns: 'a' %dprec 2 ;\n");
    $file->rules()[0]->alternatives[0]->items[1]->value // => 2

Properties§

public int $value
public Location $location

Methods§

public function __construct(public int $value, public Location $location)

Parameters

$valueintThe rank
$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