Class: Antlr4::Runtime::ATNConfigSet::ConfigEqualityComparator

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

Instance Method Summary collapse

Instance Method Details

#compare(a, b) ⇒ Object



135
136
137
138
139
# File 'lib/antlr4/runtime/atn_config_set.rb', line 135

def compare(a, b)
  return 1 if a.nil? || b.nil?
  return 0 if a.state.state_number == b.state.state_number && a.alt == b.alt && a.semantic_context.eql?(b.semantic_context)
  -1
end

#hash(o) ⇒ Object



131
132
133
# File 'lib/antlr4/runtime/atn_config_set.rb', line 131

def hash(o)
  o.bucket_hash
end