Class: Antlr4ruby::SingletonPredictionContext
Constant Summary
PredictionContext::EMPTY_RETURN_STATE
Instance Attribute Summary collapse
#cached_hash_code, #id
Class Method Summary
collapse
Instance Method Summary
collapse
from_rule_context, get_all_context_nodes, get_all_context_nodes_, get_cached_context, #has_empty_path?, #hash, #is_empty?, merge, merge_arrays, merge_root, merge_singletons, to_dot_string
Constructor Details
Returns a new instance of SingletonPredictionContext.
5
6
7
8
|
# File 'lib/antlr4ruby/atn/context/singleton_prediction_context.rb', line 5
def initialize(parent, return_state)
super(parent ? calculate_hash_code(parent, return_state) : calculate_empty_hash_code)
@parent, @return_state = parent, return_state
end
|
Instance Attribute Details
#parent ⇒ Object
Returns the value of attribute parent.
3
4
5
|
# File 'lib/antlr4ruby/atn/context/singleton_prediction_context.rb', line 3
def parent
@parent
end
|
#return_state ⇒ Object
Returns the value of attribute return_state.
3
4
5
|
# File 'lib/antlr4ruby/atn/context/singleton_prediction_context.rb', line 3
def return_state
@return_state
end
|
Class Method Details
.create(parent, return_state) ⇒ Object
10
11
12
13
|
# File 'lib/antlr4ruby/atn/context/singleton_prediction_context.rb', line 10
def self.create(parent, return_state)
return EmptyPredictionContext.INSTANCE if return_state == EMPTY_RETURN_STATE && !parent
SingletonPredictionContext.new(parent, return_state)
end
|
Instance Method Details
#eql?(other) ⇒ Boolean
31
32
33
|
# File 'lib/antlr4ruby/atn/context/singleton_prediction_context.rb', line 31
def eql?(other)
end
|
#get_parent(index) ⇒ Object
15
16
17
|
# File 'lib/antlr4ruby/atn/context/singleton_prediction_context.rb', line 15
def get_parent(index)
parent
end
|
#get_return_state(index) ⇒ Object
19
20
21
|
# File 'lib/antlr4ruby/atn/context/singleton_prediction_context.rb', line 19
def get_return_state(index)
return_state
end
|
#size ⇒ Object
23
24
25
|
# File 'lib/antlr4ruby/atn/context/singleton_prediction_context.rb', line 23
def size
1
end
|
#to_s ⇒ Object
27
28
29
|
# File 'lib/antlr4ruby/atn/context/singleton_prediction_context.rb', line 27
def to_s
end
|