rubyx/lib/register/instructions/operator_instruction.rb
2015-11-21 14:17:54 +02:00

22 lines
454 B
Ruby

module Register
class OperatorInstruction < Instruction
def initialize source , operator , left , right
super(source)
@operator = operator
@left = left
@right = right
end
attr_reader :operator, :left , :right
def to_s
"OperatorInstruction: #{left} #{operator} #{right}"
end
end
def self.op source , operator , left , right
OperatorInstruction.new source , operator , left , right
end
end