Class: Antlr4::Runtime::PredictionMode::AltAndContextConfigEqualityComparator

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/antlr4/runtime/prediction_mode.rb

Instance Method Summary collapse

Instance Method Details

#equals(a, b) ⇒ Object



21
22
23
24
25
26
# File 'lib/antlr4/runtime/prediction_mode.rb', line 21

def equals(a, b)
  return true if a == b
  return false if a.nil? || b.nil?

  a.state.state_number == b.state.state_number && a.context.eql?(b.context)
end

#hash(o) ⇒ Object



17
18
19
# File 'lib/antlr4/runtime/prediction_mode.rb', line 17

def hash(o)
  MurmurHash.hash_int_obj(o.state.state_number, o.context)
end