Class: Internal::ByteDecoder::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/decompiler/vm/bytedecoder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(local_table) ⇒ Environment

Returns a new instance of Environment.



34
35
36
37
38
39
40
# File 'lib/decompiler/vm/bytedecoder.rb', line 34

def initialize(local_table)
  @stack = []
  @expressions = []
  @local_table = local_table
  @last = nil
  @pc = 0
end

Instance Attribute Details

#expressionsObject (readonly)

Returns the value of attribute expressions.



28
29
30
# File 'lib/decompiler/vm/bytedecoder.rb', line 28

def expressions
  @expressions
end

#lastObject

Returns the value of attribute last.



30
31
32
# File 'lib/decompiler/vm/bytedecoder.rb', line 30

def last
  @last
end

#local_tableObject (readonly)

Returns the value of attribute local_table.



29
30
31
# File 'lib/decompiler/vm/bytedecoder.rb', line 29

def local_table
  @local_table
end

#pcObject

Returns the value of attribute pc.



32
33
34
# File 'lib/decompiler/vm/bytedecoder.rb', line 32

def pc
  @pc
end

#seqObject (readonly)

Returns the value of attribute seq.



31
32
33
# File 'lib/decompiler/vm/bytedecoder.rb', line 31

def seq
  @seq
end

#stackObject (readonly)

Returns the value of attribute stack.



27
28
29
# File 'lib/decompiler/vm/bytedecoder.rb', line 27

def stack
  @stack
end

Instance Method Details

#advance(instruction_length) ⇒ Object



42
43
44
# File 'lib/decompiler/vm/bytedecoder.rb', line 42

def advance(instruction_length)
  @pc += instruction_length
end

#remember(expression) ⇒ Object



46
47
48
49
50
# File 'lib/decompiler/vm/bytedecoder.rb', line 46

def remember(expression)
  if not expression.is_a?(Expression::Literal) then
    @expressions << expression
  end
end