Class: Internal::ByteDecoder::Environment
- Inherits:
-
Object
- Object
- Internal::ByteDecoder::Environment
- Defined in:
- lib/decompiler/vm/bytedecoder.rb
Instance Attribute Summary collapse
-
#expressions ⇒ Object
readonly
Returns the value of attribute expressions.
-
#last ⇒ Object
Returns the value of attribute last.
-
#local_table ⇒ Object
readonly
Returns the value of attribute local_table.
-
#pc ⇒ Object
Returns the value of attribute pc.
-
#seq ⇒ Object
readonly
Returns the value of attribute seq.
-
#stack ⇒ Object
readonly
Returns the value of attribute stack.
Instance Method Summary collapse
- #advance(instruction_length) ⇒ Object
-
#initialize(local_table) ⇒ Environment
constructor
A new instance of Environment.
- #remember(expression) ⇒ Object
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
#expressions ⇒ Object (readonly)
Returns the value of attribute expressions.
28 29 30 |
# File 'lib/decompiler/vm/bytedecoder.rb', line 28 def expressions @expressions end |
#last ⇒ Object
Returns the value of attribute last.
30 31 32 |
# File 'lib/decompiler/vm/bytedecoder.rb', line 30 def last @last end |
#local_table ⇒ Object (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 |
#pc ⇒ Object
Returns the value of attribute pc.
32 33 34 |
# File 'lib/decompiler/vm/bytedecoder.rb', line 32 def pc @pc end |
#seq ⇒ Object (readonly)
Returns the value of attribute seq.
31 32 33 |
# File 'lib/decompiler/vm/bytedecoder.rb', line 31 def seq @seq end |
#stack ⇒ Object (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 |