Class: Antlr4ruby::EmptyPredictionContext

Inherits:
SingletonPredictionContext show all
Defined in:
lib/antlr4ruby/atn/context/empty_prediction_context.rb

Constant Summary collapse

INSTANCE =
EmptyPredictionContext.new

Constants inherited from PredictionContext

PredictionContext::EMPTY_RETURN_STATE

Instance Attribute Summary

Attributes inherited from SingletonPredictionContext

#parent, #return_state

Attributes inherited from PredictionContext

#cached_hash_code, #id

Instance Method Summary collapse

Methods inherited from SingletonPredictionContext

create

Methods inherited from PredictionContext

from_rule_context, get_all_context_nodes, get_all_context_nodes_, get_cached_context, #has_empty_path?, #hash, merge, merge_arrays, merge_root, merge_singletons, to_dot_string

Constructor Details

#initialize ⇒ EmptyPredictionContext

Returns a new instance of EmptyPredictionContext.



5
6
7
# File 'lib/antlr4ruby/atn/context/empty_prediction_context.rb', line 5

def initialize
  super(nil, EMPTY_RETURN_STATE)
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/antlr4ruby/atn/context/empty_prediction_context.rb', line 25

def eql?(other)
  # todo
end

#get_parent(index) ⇒ Object



17
18
19
# File 'lib/antlr4ruby/atn/context/empty_prediction_context.rb', line 17

def get_parent(index)
  nil
end

#get_return_state(index) ⇒ Object



21
22
23
# File 'lib/antlr4ruby/atn/context/empty_prediction_context.rb', line 21

def get_return_state(index)
  return_state
end

#is_empty? ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/antlr4ruby/atn/context/empty_prediction_context.rb', line 9

def is_empty?
  true
end

#size ⇒ Object



13
14
15
# File 'lib/antlr4ruby/atn/context/empty_prediction_context.rb', line 13

def size
  1
end

#to_s ⇒ Object



29
30
31
# File 'lib/antlr4ruby/atn/context/empty_prediction_context.rb', line 29

def to_s
  '$'
end