Class: Tataru::Memory
- Inherits:
-
Object
- Object
- Tataru::Memory
- Defined in:
- lib/tataru/memory.rb
Overview
memory that can be manipulated by instructions
Instance Attribute Summary collapse
-
#call_stack ⇒ Object
Returns the value of attribute call_stack.
-
#end ⇒ Object
Returns the value of attribute end.
-
#error ⇒ Object
Returns the value of attribute error.
-
#hash ⇒ Object
Returns the value of attribute hash.
-
#program_counter ⇒ Object
Returns the value of attribute program_counter.
Instance Method Summary collapse
-
#initialize ⇒ Memory
constructor
A new instance of Memory.
Constructor Details
#initialize ⇒ Memory
Returns a new instance of Memory.
8 9 10 11 12 13 14 |
# File 'lib/tataru/memory.rb', line 8 def initialize @program_counter = 0 @hash = { temp: {} } @error = nil @call_stack = [] @end = false end |
Instance Attribute Details
#call_stack ⇒ Object
Returns the value of attribute call_stack.
6 7 8 |
# File 'lib/tataru/memory.rb', line 6 def call_stack @call_stack end |
#end ⇒ Object
Returns the value of attribute end.
6 7 8 |
# File 'lib/tataru/memory.rb', line 6 def end @end end |
#error ⇒ Object
Returns the value of attribute error.
6 7 8 |
# File 'lib/tataru/memory.rb', line 6 def error @error end |
#hash ⇒ Object
Returns the value of attribute hash.
6 7 8 |
# File 'lib/tataru/memory.rb', line 6 def hash @hash end |
#program_counter ⇒ Object
Returns the value of attribute program_counter.
6 7 8 |
# File 'lib/tataru/memory.rb', line 6 def program_counter @program_counter end |