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

#initializeEmptyPredictionContext



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



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



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

def is_empty?
  true
end

#sizeObject



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

def size
  1
end

#to_sObject



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

def to_s
  '$'
end