Module: PopInstruction

Included in:
BoolPopInstruction, CodePopInstruction, ExecPopInstruction, FloatPopInstruction, IntPopInstruction, NamePopInstruction
Defined in:
lib/instructions/infrastructure.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#target_stackObject (readonly)

Returns the value of attribute target_stack.



123
124
125
# File 'lib/instructions/infrastructure.rb', line 123

def target_stack
  @target_stack
end

Instance Method Details

#cleanupObject



138
139
# File 'lib/instructions/infrastructure.rb', line 138

def cleanup
end

#deriveObject



136
137
# File 'lib/instructions/infrastructure.rb', line 136

def derive
end

#initialize(context, target_stack) ⇒ Object



125
126
127
128
# File 'lib/instructions/infrastructure.rb', line 125

def initialize(context, target_stack)
  @target_stack = target_stack
  super(context)
end

#preconditions?Boolean

Returns:

  • (Boolean)


130
131
132
# File 'lib/instructions/infrastructure.rb', line 130

def preconditions?
  needs @target_stack, 1
end

#setupObject



133
134
135
# File 'lib/instructions/infrastructure.rb', line 133

def setup
  @result = @context.pop(@target_stack)
end