Module: DepthInstruction
- Included in:
- BoolDepthInstruction, CodeDepthInstruction, ExecDepthInstruction, FloatDepthInstruction, IntDepthInstruction, NameDepthInstruction
- 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.
217 218 219 |
# File 'lib/instructions/infrastructure.rb', line 217 def target_stack @target_stack end |
Instance Method Details
#cleanup ⇒ Object
232 233 234 |
# File 'lib/instructions/infrastructure.rb', line 232 def cleanup pushes :int, @result end |
#derive ⇒ Object
229 230 231 |
# File 'lib/instructions/infrastructure.rb', line 229 def derive @result = ValuePoint.new("int",@context.stacks[@target_stack].depth.to_s) end |
#initialize(context, target_stack) ⇒ Object
219 220 221 222 |
# File 'lib/instructions/infrastructure.rb', line 219 def initialize(context, target_stack) @target_stack = target_stack super(context) end |
#preconditions? ⇒ Boolean
224 225 226 |
# File 'lib/instructions/infrastructure.rb', line 224 def preconditions? @context.stacks[@target_stack].depth != nil end |
#setup ⇒ Object
227 228 |
# File 'lib/instructions/infrastructure.rb', line 227 def setup end |