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

A %merge modifier naming the function that merges GLR ambiguities.

Reading a merge functiondoctest
$file = (new \BisonParser\Parser())->parse("%glr-parser\n%%\ns: 'a' %merge <stmtMerge> ;\n");
    $file->rules()[0]->alternatives[0]->items[1]->tag // => 'stmtMerge'

Properties§

public string $tag
public Location $location

Methods§

public function __construct(public string $tag, public Location $location)

Parameters

$tagstringThe function name written between angle brackets
$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