Class: Nodewrap::ByteDecoder::Environment
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.
31 32 33 34 35 36 37 |
# File 'lib/bytedecoder.rb', line 31 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.
25 26 27 |
# File 'lib/bytedecoder.rb', line 25 def expressions @expressions end |
#last ⇒ Object
Returns the value of attribute last.
27 28 29 |
# File 'lib/bytedecoder.rb', line 27 def last @last end |
#local_table ⇒ Object (readonly)
Returns the value of attribute local_table.
26 27 28 |
# File 'lib/bytedecoder.rb', line 26 def local_table @local_table end |
#pc ⇒ Object
Returns the value of attribute pc.
29 30 31 |
# File 'lib/bytedecoder.rb', line 29 def pc @pc end |
#seq ⇒ Object (readonly)
Returns the value of attribute seq.
28 29 30 |
# File 'lib/bytedecoder.rb', line 28 def seq @seq end |
#stack ⇒ Object (readonly)
Returns the value of attribute stack.
24 25 26 |
# File 'lib/bytedecoder.rb', line 24 def stack @stack end |
Instance Method Details
#advance(instruction_length) ⇒ Object
39 40 41 |
# File 'lib/bytedecoder.rb', line 39 def advance(instruction_length) @pc += instruction_length end |
#remember(expression) ⇒ Object
43 44 45 46 47 |
# File 'lib/bytedecoder.rb', line 43 def remember(expression) if not expression.is_a?(Expression::Literal) then @expressions << expression end end |