Class: PredPrediction

Inherits:
Object show all
Defined in:
lib/antlr4/dfa/DFAState.rb

Overview

Map a predicate to a predicted alternative.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pred, alt) ⇒ PredPrediction

Returns a new instance of PredPrediction.



5
6
7
8
# File 'lib/antlr4/dfa/DFAState.rb', line 5

def initialize(pred, alt)
    @alt = alt
    @pred = pred
end

Instance Attribute Details

#altObject

Returns the value of attribute alt.



4
5
6
# File 'lib/antlr4/dfa/DFAState.rb', line 4

def alt
  @alt
end

#predObject

Returns the value of attribute pred.



4
5
6
# File 'lib/antlr4/dfa/DFAState.rb', line 4

def pred
  @pred
end

Instance Method Details

#to_sObject



10
11
12
# File 'lib/antlr4/dfa/DFAState.rb', line 10

def to_s
  "(#{self.pred}, #{self.alt})"
end