Class: EmptyPredictionContext

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

Constant Summary

Constants inherited from PredictionContext

PredictionContext::EMPTY_RETURN_STATE

Instance Attribute Summary

Attributes inherited from SingletonPredictionContext

#cache_string, #parentCtx, #returnState

Attributes inherited from PredictionContext

#cachedHashCode

Instance Method Summary collapse

Methods inherited from SingletonPredictionContext

#==, create, #eql?, #hash, #length, #mk_string

Methods inherited from PredictionContext

EMPTY, EMPTY_RETURN_STATE, calculateEmptyHashCode, calculateHashCode, #hasEmptyPath, #hash

Constructor Details

#initialize(h = nil) ⇒ EmptyPredictionContext

Returns a new instance of EmptyPredictionContext.



171
172
173
174
# File 'lib/antlr4/PredictionContext.rb', line 171

def initialize(h=nil) 
    super(nil, PredictionContext::EMPTY_RETURN_STATE )
    @cachedHashCode = "".hash
end

Instance Method Details

#getParent(index) ⇒ Object



180
181
182
# File 'lib/antlr4/PredictionContext.rb', line 180

def getParent(index)
  nil
end

#getReturnState(index) ⇒ Object



184
185
186
# File 'lib/antlr4/PredictionContext.rb', line 184

def getReturnState(index)
    PredictionContext::EMPTY_RETURN_STATE # self.returnState
end

#isEmptyObject



176
177
178
# File 'lib/antlr4/PredictionContext.rb', line 176

def isEmpty
   true
end

#to_sObject

def ==(other)

    self.equal? other
end


192
193
194
# File 'lib/antlr4/PredictionContext.rb', line 192

def to_s
    "$"
end