Class: Internal::ByteDecoder::Expression::Throw

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

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, value) ⇒ Throw

Returns a new instance of Throw.



431
432
433
434
# File 'lib/decompiler/vm/bytedecoder.rb', line 431

def initialize(pc, value)
  super(pc)
  @value = value
end

Instance Method Details

#precedenceObject



445
446
447
# File 'lib/decompiler/vm/bytedecoder.rb', line 445

def precedence
  return 1
end

#to_sObject



436
437
438
439
440
441
442
443
# File 'lib/decompiler/vm/bytedecoder.rb', line 436

def to_s
  # TODO: not all throws are breaks...
  if not @value or (@value.is_a?(Literal) and @value.value == nil) then
    return "break"
  else
    return "break #{@value}"
  end
end