Class: ExecSInstruction

Inherits:
Instruction show all
Defined in:
lib/instructions/exec/exec_s.rb

Instance Attribute Summary

Attributes inherited from Instruction

#context

Instance Method Summary collapse

Methods inherited from Instruction

all_instructions, #go, inherited, #initialize, #needs, #pushes, to_nudgecode

Constructor Details

This class inherits a constructor from Instruction

Instance Method Details

#cleanupObject



13
14
15
16
17
# File 'lib/instructions/exec/exec_s.rb', line 13

def cleanup
  pushes :exec, @s_result
  pushes :exec, @argC
  pushes :exec, @argA
end

#deriveObject



10
11
12
# File 'lib/instructions/exec/exec_s.rb', line 10

def derive  
  @s_result = CodeblockPoint.new([@argB,@argC])
end

#preconditions?Boolean

Returns:

  • (Boolean)


2
3
4
# File 'lib/instructions/exec/exec_s.rb', line 2

def preconditions?
  needs :exec, 3
end

#setupObject



5
6
7
8
9
# File 'lib/instructions/exec/exec_s.rb', line 5

def setup
  @argA = @context.pop(:exec)
  @argB = @context.pop(:exec)
  @argC = @context.pop(:exec)
end