classTypeDeclaration
final class TypeDeclaration
implements Declaration
Public API: explicitly declared with
@visibility public.%type symbol { type }: the C type of a nonterminal's value.
$file = (new \LemonParser\Parser())->parse("%type expr {Expr*}\n");
$type = $file->declarations()[0];
[$type->symbol->name, $type->value] // => ['expr', 'Expr*']Properties§
public Symbol $symbolpublic string $valuepublic ArgumentForm $formpublic Location $locationMethods§
public function __construct(
public Symbol $symbol,
public string $value,
public ArgumentForm $form,
public Location $location,
)Parameters
$symbol | Symbol | The symbol being typed |
$value | string | The argument without its delimiters |
$form | ArgumentForm | How the argument was written |
$location | Location | Where the `%` sign is |
public function location(): LocationTest cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.