classTag
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.
$tag = new \BisonParser\Ast\Tag('std::vector<int>', new \BisonParser\Ast\Location(1, 8));
$tag->name // => 'std::vector<int>'
$tag->isAny() // => falseConstants§
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 $namepublic Location $locationMethods§
public function __construct(public string $name, public Location $location)Parameters
$name | string | Text between the angle brackets |
$location | Location | Where the tag is written |
public function isAny(): boolReports whether the tag is <*>.
Returns
bool True for the tag of every tagged symbolTest cases 1
TagTest::testIsAnycalls
Calls 1
- class-const Tag::ANY() line 50
public function isNone(): boolReports whether the tag is <>.
Returns
bool True for the tag of every untagged symbolTest cases 1
TagTest::testIsNonecalls
Calls 1
- class-const Tag::NONE() line 60
Test cases 12§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
TagTest::testIsAnycallsTagTest::testIsNonecalls
Other tests reaching this symbol 10
TreeDumper::targetcallsCodePropsTest::testLocationcallsBisonGrammarCompilerTestcallsBisonGrammarReaderTestcallsDeclarationPrinterTest::testPrintcallsDeclarationPrinterTest::testPropscallsDeclarationPrinterTest::testTargetscallsSymbolPrinterTest::testTagcallsDeclarationParserTest::testDirectivecallsSymbolListParserTest::testTargetscalls