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

A semantic predicate %?{ ... } on a right-hand side.

Reading a predicatedoctest
$file = (new \BisonParser\Parser())->parse("%%\ns: %?{ new_syntax } 'a' ;\n");
    $file->rules()[0]->alternatives[0]->items[0]->code // => ' new_syntax '

Properties§

public string $code
public Location $location

Methods§

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

Parameters

$codestringThe code without its braces
$locationLocationWhere the `%?` is written
public function location(): Location

Answers where the item begins.

Returns

Location Line and column of the `%?`
Test cases 1

Test cases 7§

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 6

Relations§

Instantiated in 1
Constant reads 1
Type checks 3