interface Declaration
Public API: explicitly declared with @visibility public.

Something written after a % sign.

Walking the declarations of a filedoctest
$file = (new \LemonParser\Parser())->parse("%token_prefix TK_\n%left PLUS.\n");
    array_map(static fn (\LemonParser\Ast\Declaration\Declaration $d) => (string) $d->location(), $file->declarations()) // => ['1:1', '2:1']

Methods§

public function location(): Location

Answers where the % sign is written.

Returns

Location The position

Test cases 4§

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 3

Relations§

Implemented by 8
Method calls 3
Type checks 1
Type declarations 3