classNullableSet
final class NullableSet
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
The nonterminals that can derive the empty string.
Methods§
public function __construct(Grammar $grammar)Computes the set by iterating over the rules until nothing changes.
Parameters
$grammar | Grammar | Grammar to inspect |
public function isNullable(int $symbol): boolReports whether a symbol derives the empty string.
Parameters
$symbol | int | Symbol number |
Returns
bool True for a nullable nonterminal, false for terminals and other nonterminalsTest cases 1
Called from 1
public function tailNullable(list<int> $symbols, int $from): boolReports whether every symbol from a position onward derives the empty string.
Parameters
$symbols | list<int> | Symbols to inspect |
$from | int | Position to start at |
Returns
bool True when the tail is empty or all of it is nullableTest cases 1
Called from 1
Calls 1
- function-call
countline 69
Private surface 1§
Implementation details, listed for orientation only.
private array<int, true> $nullableTest cases 7§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.