text: public static int GetSingleViableAlt(IEnumerable<BitSet> altsets){BitSet viableAlts = new BitSet();foreach (BitSet alts in altsets){int minAlt = alts.NextSetBit(0);viableAlts.Set(minAlt);if (viableAlts.Cardinality() > 1){return ATN.INVALID_ALT_NUMBER;}}return viableAlts.NextSetBit(0);}