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

Reads the tokens a Lemon grammar declares before any rule is written.

Lemon declares its tokens in several places: outright with %token, in passing while giving them a precedence, as a fallback, as a named class of tokens that stand for one another, and as the single wildcard token. Each form says the same thing — this name is a token — so all of them are read together and told to the symbol table.

Methods§

public function declareInto(string $input, LemonSymbols $symbols): void

Tells the symbol table about every token the directives name.

Parameters

$inputstringContents of the grammar file
$symbolsLemonSymbolsSymbol table to record them in
Test cases 5
Called from 1
Calls 6
public function tokenClasses(string $input): array<string, list<string>>

Exposes each declared token class as its complete set of alternatives.

Parameters

$inputstring

Returns

array<string, list<string>>
Test cases 2
Called from 1
Calls 5

Test cases 7§

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

Dedicated tests 6
Other tests reaching this symbol 1

Relations§

Instantiated in 1
Method calls 2
Type declarations 1