final class Tag
Public API: explicitly declared with @visibility public.

A type tag written between angle brackets.

Besides a named tag such as <int>, a %destructor or %printer may name <*>, every tagged symbol, and <>, every untagged symbol. They are kept as Bison keeps them: * and the empty string.

Reading a tagdoctest
$tag = new \BisonParser\Ast\Tag('std::vector<int>', new \BisonParser\Ast\Location(1, 8));
    $tag->name // => 'std::vector<int>'
    $tag->isAny() // => false

Constants§

public const ANY = '*'

The name of the tag that stands for every tagged symbol.

public const NONE = ''

The name of the tag that stands for every untagged symbol.

Properties§

public string $name
public Location $location

Methods§

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

Parameters

$namestringText between the angle brackets
$locationLocationWhere the tag is written
public function isAny(): bool

Reports whether the tag is <*>.

Returns

bool True for the tag of every tagged symbol
Test cases 1
Calls 1
public function isNone(): bool

Reports whether the tag is <>.

Returns

bool True for the tag of every untagged symbol
Test cases 1
Calls 1

Test cases 12§

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

Dedicated tests 2
Other tests reaching this symbol 10

Relations§

Instantiated in 1
Type checks 1
Type declarations 1