classDigraph
final class Digraph
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Closes sets over a relation: each node ends with the union of every node it reaches.
This is the traversal of DeRemer and Pennello, which finds the strongly connected components of the relation and gives every member of a component the same set. It runs on an explicit stack, as the relations of a large grammar chain deeper than the call stack should be asked to go.
Methods§
public function close(
int $nodeCount,
array<int, list<int>> $edges,
array<int, array<int, int>> $sets,
): array<int, array<int, int>>Closes the sets.
Parameters
$nodeCount | int | How many nodes there are, numbered from zero |
$edges | array<int, list<int>> | Nodes each node reaches directly |
$sets | array<int, array<int, int>> | Initial set of each node, as bitset words |
Returns
array<int, array<int, int>> Closed set of each nodeTest cases 1
Called from 2
Calls 2
- function-call
array_fillline 30 - method-call Digraph::traverse() line 34
public function traverse(
int $root,
array<int, list<int>> $edges,
array<int, array<int, int>> &$sets,
array<int, int> &$marks,
list<int> &$stack,
): voidTraverses the relation from one node, closing every node it reaches.
Parameters
$root | int | Node to start from |
$edges | array<int, list<int>> | Nodes each node reaches directly |
$sets | array<int, array<int, int>> | Sets being closed, updated in place |
$marks | array<int, int> | Traversal marks, updated in place |
$stack | list<int> | Nodes of the component being explored, updated in place |
Test cases 1
Called from 1
Calls 4
- function-call
countline 53 - function-call
minline 66 - static-call Bitset::union() line 67
- function-call
array_popline 71
Test cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 3
LookaheadSetsTestcallsParseTableBuilderTestcallsLrParserTestcalls