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

Reads the lists of terminals that end with a period.

Methods§

public function ranked(TokenStream $tokens, SymbolRegistry $registry): list<Symbol>

Reads the terminals of %left, %right or %nonassoc.

Parameters

$tokensTokenStreamThe rest
$registrySymbolRegistrySymbols seen so far

Returns

list<Symbol> The terminals

Throws

SyntaxException When something is not a terminal or already ranked
Test cases 2
Called from 1
Calls 4
public function fallbacks(TokenStream $tokens, SymbolRegistry $registry): list<Symbol>

Reads the terminals of %fallback.

Parameters

$tokensTokenStreamThe rest
$registrySymbolRegistrySymbols seen so far

Returns

list<Symbol> The fallback first, then the tokens that fall back to it

Throws

SyntaxException When something is not a terminal or already falls back
Test cases 3
Called from 1
Calls 5
public function tokens(
    TokenStream $tokens,
    SymbolRegistry $registry,
    string $keyword,
): list<Symbol>

Reads the terminals of %token.

Parameters

$tokensTokenStreamThe rest
$registrySymbolRegistrySymbols seen so far
$keywordstringThe keyword, for messages

Returns

list<Symbol> The terminals

Throws

SyntaxException When something is not a terminal
Test cases 2
Called from 1
Calls 4
public function wildcard(TokenStream $tokens, SymbolRegistry $registry): Symbol|null

Reads the terminal of %wildcard.

Parameters

$tokensTokenStreamThe rest
$registrySymbolRegistrySymbols seen so far

Returns

Symbol|null The terminal, or null when none was written

Throws

SyntaxException When something is not a terminal or a second one is named
Test cases 3
Called from 1
Calls 4
public function classTokens(TokenStream $tokens, SymbolRegistry $registry): list<Symbol>

Reads the terminals of %token_class, written bare or after | or /.

Parameters

$tokensTokenStreamThe rest
$registrySymbolRegistrySymbols seen so far

Returns

list<Symbol> The terminals

Throws

SyntaxException When something is not a terminal
Test cases 2
Called from 1
Calls 6

Test cases 19§

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

Dedicated tests 14
Other tests reaching this symbol 5

Relations§

Instantiated in 1
Method calls 5
Type declarations 1