Method: PredictionMode.getUniqueAlt

Defined in:
lib/antlr4/atn/PredictionMode.rb

.getUniqueAlt(altsets) ⇒ Object

Returns the unique alternative predicted by all alternative subsets in altsets. If no such alternative exists, this method returns ATN#INVALID_ALT_NUMBER.

Parameters:

  • altsets

    a collection of alternative subsets



440
441
442
443
444
445
446
447
# File 'lib/antlr4/atn/PredictionMode.rb', line 440

def self.getUniqueAlt(altsets)
    all = getAlts(altsets)
    if all.length==1
        return all[0]
    else
        return ATN::INVALID_ALT_NUMBER
    end
end