Class: Antlr4::Runtime::EmptyPredictionContext

Inherits:
SingletonPredictionContext show all
Defined in:
lib/antlr4/runtime/empty_prediction_context.rb

Constant Summary collapse

EMPTY =
EmptyPredictionContext.new(PredictionContextUtils::EMPTY_RETURN_STATE)

Constants inherited from PredictionContext

PredictionContext::EMPTY_RETURN_STATE, PredictionContext::INITIAL_HASH

Instance Attribute Summary

Attributes inherited from PredictionContext

#cachedHashCode

Instance Method Summary collapse

Methods inherited from SingletonPredictionContext

#empty?, #get_parent, #get_return_state

Methods inherited from PredictionContext

#empty_path?, #hash, #to_s_recog, #to_strings, #to_strings3, #to_strings3_inner

Constructor Details

#initialize(return_state) ⇒ EmptyPredictionContext

Returns a new instance of EmptyPredictionContext


4
5
6
# File 'lib/antlr4/runtime/empty_prediction_context.rb', line 4

def initialize(return_state)
  super(nil, return_state)
end

Instance Method Details

#equals(o) ⇒ Object


26
27
28
# File 'lib/antlr4/runtime/empty_prediction_context.rb', line 26

def equals(o)
  self == o
end

#isEmptyObject


10
11
12
# File 'lib/antlr4/runtime/empty_prediction_context.rb', line 10

def isEmpty
  true
end

#parent(_index = nil) ⇒ Object


18
19
20
# File 'lib/antlr4/runtime/empty_prediction_context.rb', line 18

def parent(_index=nil)
  nil
end

#return_state(_index = nil) ⇒ Object


22
23
24
# File 'lib/antlr4/runtime/empty_prediction_context.rb', line 22

def return_state(_index=nil)
  @return_state
end

#sizeObject


14
15
16
# File 'lib/antlr4/runtime/empty_prediction_context.rb', line 14

def size
  1
end

#to_sObject


30
31
32
# File 'lib/antlr4/runtime/empty_prediction_context.rb', line 30

def to_s
  '$'
end