Class: Internal::ByteDecoder::Expression::Constant

Inherits:
Internal::ByteDecoder::Expression show all
Defined in:
lib/decompiler/vm/bytedecoder.rb

Direct Known Subclasses

ConstantAssignment

Instance Attribute Summary

Attributes inherited from Internal::ByteDecoder::Expression

#pc

Instance Method Summary collapse

Methods inherited from Internal::ByteDecoder::Expression

#<=>, #fmt

Constructor Details

#initialize(pc, klass, name) ⇒ Constant

Returns a new instance of Constant.



327
328
329
330
331
# File 'lib/decompiler/vm/bytedecoder.rb', line 327

def initialize(pc, klass, name)
  super(pc)
  @klass = klass
  @name = name
end

Instance Method Details

#precedenceObject



345
346
347
# File 'lib/decompiler/vm/bytedecoder.rb', line 345

def precedence
  return 1
end

#to_sObject



333
334
335
336
337
338
339
340
341
342
343
# File 'lib/decompiler/vm/bytedecoder.rb', line 333

def to_s
  if @klass then
    if @klass == Object then
      return "::#{@name}"
    else
      return "#{@klass}::#{@name}"
    end
  else
    return "#{@name}"
  end
end