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

Removes from a Lemon file everything that is not grammar.

A Lemon file carries the C the generated parser is built from as well as the rules it recognises: comments, include blocks, destructors, and declarations about types and names. None of that says what the parser accepts, and all of it can contain text that reads like a rule, so it is taken out before the rules are looked for.

Methods§

public function withoutComments(string $input): string

Removes C comments.

Parameters

$inputstringContents of the grammar file

Returns

string The same text with its comments gone
Test cases 2
Called from 1
Calls 1
public function withoutDirectiveBlocks(string $input): string

Removes the directives that carry C or configure the generated parser.

Parameters

$inputstringContents of the grammar file

Returns

string The same text with those directives gone
Test cases 2
Called from 1
Calls 1

Test cases 6§

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

Dedicated tests 4
Other tests reaching this symbol 2

Relations§

Instantiated in 2
Method calls 2
Type declarations 2