Module: RotateInstruction
- Included in:
- BoolRotateInstruction, CodeRotateInstruction, ExecRotateInstruction, FloatRotateInstruction, IntRotateInstruction, NameRotateInstruction
- Defined in:
- lib/instructions/infrastructure.rb
Instance Attribute Summary collapse
-
#target_stack ⇒ Object
readonly
Returns the value of attribute target_stack.
Instance Method Summary collapse
- #cleanup ⇒ Object
- #derive ⇒ Object
- #initialize(context, target_stack) ⇒ Object
- #preconditions? ⇒ Boolean
- #setup ⇒ Object
Instance Attribute Details
#target_stack ⇒ Object (readonly)
Returns the value of attribute target_stack.
191 192 193 |
# File 'lib/instructions/infrastructure.rb', line 191 def target_stack @target_stack end |
Instance Method Details
#cleanup ⇒ Object
208 209 210 211 212 |
# File 'lib/instructions/infrastructure.rb', line 208 def cleanup pushes @target_stack, @arg2 pushes @target_stack, @arg3 pushes @target_stack, @arg1 end |
#derive ⇒ Object
206 207 |
# File 'lib/instructions/infrastructure.rb', line 206 def derive end |
#initialize(context, target_stack) ⇒ Object
193 194 195 196 |
# File 'lib/instructions/infrastructure.rb', line 193 def initialize(context, target_stack) @target_stack = target_stack super(context) end |
#preconditions? ⇒ Boolean
198 199 200 |
# File 'lib/instructions/infrastructure.rb', line 198 def preconditions? needs @target_stack, 3 end |
#setup ⇒ Object
201 202 203 204 205 |
# File 'lib/instructions/infrastructure.rb', line 201 def setup @arg3 = @context.pop(@target_stack) @arg2 = @context.pop(@target_stack) @arg1 = @context.pop(@target_stack) end |