classBitset
final class Bitset
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Sets of terminals as arrays of 32-bit words.
Lookahead computation unions tens of thousands of sets, so they are kept as plain word arrays and operated on in place rather than as objects.
Methods§
public static function empty(int $size): array<int, int>Makes an empty set able to hold a number of members.
Parameters
$size | int | How many members the set may hold |
Returns
array<int, int> The words, all zeroTest cases 10
BitsetTest::testAddcallsBitsetTest::testEmptycallsBitsetTest::testHascallsBitsetTest::testMemberscallsBitsetTest::testUnioncallsConflictResolverTest::testResolveCountsAnUnrankedShiftReduceConflictAndShiftscallsConflictResolverTest::testResolveCountsAReduceReduceConflictAndKeepsTheEarlierRulecallsConflictResolverTest::testResolveKeepsPlainShiftsAndReductionscallsConflictResolverTest::testResolveLetsAHigherRankedLaterRuleWinUnderLemonsPolicycallsParseTableBuilderTest::testExpandLookaheadscalls
Called from 2
public static function add(array<int, int> &$words, int $member): voidAdds a member.
Parameters
$words | array<int, int> | Set to add to |
$member | int | Member to add |
Test cases 9
BitsetTest::testAddcallsBitsetTest::testHascallsBitsetTest::testMemberscallsBitsetTest::testUnioncallsConflictResolverTest::testResolveCountsAnUnrankedShiftReduceConflictAndShiftscallsConflictResolverTest::testResolveCountsAReduceReduceConflictAndKeepsTheEarlierRulecallsConflictResolverTest::testResolveKeepsPlainShiftsAndReductionscallsConflictResolverTest::testResolveLetsAHigherRankedLaterRuleWinUnderLemonsPolicycallsParseTableBuilderTest::testExpandLookaheadscalls
public static function has(array<int, int> $words, int $member): boolReports whether a member is present.
Parameters
$words | array<int, int> | Set to look in |
$member | int | Member to look for |
Returns
bool True when presentTest cases 1
BitsetTest::testHascalls
public static function union(array<int, int> &$into, array<int, int> $from): voidAdds every member of one set to another.
Parameters
$into | array<int, int> | Set to add to |
$from | array<int, int> | Set whose members are added |
Test cases 1
BitsetTest::testUnioncalls
Called from 3
- static-call SqlParser\Automaton\Digraph::traverse() packages/sql-parser/src/Automaton/Digraph.php:67
- static-call SqlParser\Automaton\Digraph::traverse() packages/sql-parser/src/Automaton/Digraph.php:84
- static-call SqlParser\Automaton\LookaheadSets::__construct() packages/sql-parser/src/Automaton/LookaheadSets.php:74
public static function members(array<int, int> $words): list<int>Lists the members in ascending order.
Parameters
$words | array<int, int> | Set to list |
Returns
list<int> The membersTest cases 6
Called from 1
Test cases 15§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
BitsetTest::testAddcallsBitsetTest::testEmptycallsBitsetTest::testHascallsBitsetTest::testMemberscallsBitsetTest::testUnioncalls
Other tests reaching this symbol 10
ConflictResolverTest::testResolveCountsAnUnrankedShiftReduceConflictAndShiftscallsConflictResolverTest::testResolveCountsAReduceReduceConflictAndKeepsTheEarlierRulecallsConflictResolverTest::testResolveKeepsPlainShiftsAndReductionscallsConflictResolverTest::testResolveLetsAHigherRankedLaterRuleWinUnderLemonsPolicycallsDigraphTestcallsLookaheadSetsTest::testOfFollowsTheTextbookGrammarcallsLookaheadSetsTest::testOfReadsThroughNullableNonterminalscallsLookaheadSetsTest::testReadscallsParseTableBuilderTest::testExpandLookaheadscallsLrParserTestcalls
Relations§
Static calls 9
- static-call SqlParser\Automaton\ConflictResolver::resolve() packages/sql-parser/src/Automaton/ConflictResolver.php:53
- static-call SqlParser\Automaton\Digraph::traverse() packages/sql-parser/src/Automaton/Digraph.php:67
- static-call SqlParser\Automaton\Digraph::traverse() packages/sql-parser/src/Automaton/Digraph.php:84
- static-call SqlParser\Automaton\LookaheadSets::__construct() packages/sql-parser/src/Automaton/LookaheadSets.php:72
- static-call SqlParser\Automaton\LookaheadSets::__construct() packages/sql-parser/src/Automaton/LookaheadSets.php:74
- static-call SqlParser\Automaton\LookaheadSets::reads() packages/sql-parser/src/Automaton/LookaheadSets.php:99
- static-call SqlParser\Automaton\LookaheadSets::reads() packages/sql-parser/src/Automaton/LookaheadSets.php:102
- static-call SqlParser\Automaton\ParseTableBuilder::expandLookaheads() packages/sql-parser/src/Automaton/ParseTableBuilder.php:170
- static-call SqlParser\Automaton\ParseTableBuilder::expandLookaheads() packages/sql-parser/src/Automaton/ParseTableBuilder.php:174