classAlias
final class Alias
Public API: explicitly declared with
@visibility public.The string alias of a token, as in %token PLUS "+" or %token END _("end of file").
$file = (new \BisonParser\Parser())->parse("%token END 0 _(\"end of file\")\n%%\ns: END;\n");
$file->declarations[0]->entries[0]->alias?->text // => 'end of file'
$file->declarations[0]->entries[0]->alias?->translatable // => trueProperties§
public string $textpublic bool $translatablepublic Location $locationpublic string|null $spelling = nullMethods§
public function __construct(
public string $text,
public bool $translatable,
public Location $location,
public string|null $spelling = null,
)Parameters
$text | string | The decoded string |
$translatable | bool | Whether the alias was written as `_("...")` |
$location | Location | Where the alias is written |
$spelling | string|null | The alias as written, quotes and escapes included; null when built by hand |
Test cases 11§
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 10
TreeDumpercallsSymbolDeclarationTest::testLocationcallsSymbolEntryTest::testAliascallsBisonGrammarCompilerTestcallsBisonGrammarReaderTestcallsParserTestcallsDeclarationPrinterTest::testEntriescallsDeclarationPrinterTest::testPrintcallsDeclarationParserTestcallsSymbolListParserTestcalls