Skip to content

Commit

Permalink
Improve implementation of ParserATNSimulator::getConflictingAlts()
Browse files Browse the repository at this point in the history
PredictionModeClass::getAlts(configs)
yields the same result as
PredictionModeClass::getAlts(
  PredictionModeClass::getConflictingAltSubsets(configs)
)
Both return a BitSet with bits set for all alts which occur in configs.

Signed-off-by: Andreas Buhr <andreas@andreasbuhr.de>
  • Loading branch information
andreasbuhr committed Apr 11, 2024
1 parent 380ce4b commit 4977cd9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1201,8 +1201,7 @@ Ref<ATNConfig> ParserATNSimulator::ruleTransition(Ref<ATNConfig> const& config,
}

BitSet ParserATNSimulator::getConflictingAlts(ATNConfigSet *configs) {
std::vector<BitSet> altsets = PredictionModeClass::getConflictingAltSubsets(configs);
return PredictionModeClass::getAlts(altsets);
return PredictionModeClass::getAlts(configs);
}

BitSet ParserATNSimulator::getConflictingAltsOrUniqueAlt(ATNConfigSet *configs) {
Expand Down

0 comments on commit 4977cd9

Please sign in to comment.