final class DeclarationReader
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

Reads a declaration after its % sign, as Lemon's declaration states do.

Methods§

public function __construct(private SymbolListReader $lists = new \LemonParser\Syntax\SymbolListReader())

Parameters

$listsSymbolListReaderReads lists of terminals ended by a period
Calls 1
public function argument(TokenStream $tokens, Token $keyword): array{string, ArgumentForm}
public function readDestructor(
    TokenStream $tokens,
    SymbolRegistry $registry,
    Location $at,
): Destructor

Reads %destructor symbol argument.

Parameters

$tokensTokenStreamThe rest
$registrySymbolRegistrySymbols seen so far
$atLocationWhere the `%` is

Returns

Destructor The declaration

Throws

SyntaxException When no symbol follows
Test cases 2
Called from 1
Calls 6
public function readType(
    TokenStream $tokens,
    SymbolRegistry $registry,
    Location $at,
): TypeDeclaration
public function readTokenClass(
    TokenStream $tokens,
    SymbolRegistry $registry,
    Location $at,
): TokenClass

Private surface 1§

Implementation details, listed for orientation only.

private SymbolListReader $lists = new \LemonParser\Syntax\SymbolListReader()

Test cases 17§

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

Dedicated tests 13
Other tests reaching this symbol 4

Relations§

Instantiated in 1
Method calls 1
Type declarations 1