Merge pull request #540 from sharwell/fix-528

Updated documentation for ParserATNSimulator.getConflictingAlts
This commit is contained in:
Sam Harwell 2014-04-06 16:51:21 -05:00
commit 9c6023b385
2 changed files with 12 additions and 2 deletions

View File

@ -1617,7 +1617,17 @@ public class ParserATNSimulator extends ATNSimulator {
return new ATNConfig(config, t.target, newContext);
}
protected BitSet getConflictingAlts(ATNConfigSet configs) {
/**
* Gets a {@link BitSet} containing the alternatives in {@code configs}
* which are part of one or more conflicting alternative subsets.
*
* @param configs The {@link ATNConfigSet} to analyze.
* @return The alternatives in {@code configs} which are part of one or more
* conflicting alternative subsets. If {@code configs} does not contain any
* conflicting subsets, this method returns an empty {@link BitSet}.
*/
@NotNull
protected BitSet getConflictingAlts(@NotNull ATNConfigSet configs) {
Collection<BitSet> altsets = PredictionMode.getConflictingAltSubsets(configs);
return PredictionMode.getAlts(altsets);
}

View File

@ -556,7 +556,7 @@ public enum PredictionMode {
* </pre>
*/
@NotNull
public static Collection<BitSet> getConflictingAltSubsets(ATNConfigSet configs) {
public static Collection<BitSet> getConflictingAltSubsets(@NotNull ATNConfigSet configs) {
AltAndContextMap configToAlts = new AltAndContextMap();
for (ATNConfig c : configs) {
BitSet alts = configToAlts.get(c);