class IDL::Expression::Operation
def initialize(*_operands)
def initialize(*_operands) n = self.class::NUMBER_OF_OPERANDS if _operands.size != n raise format("%s must receive %d operand%s.", self.typename, n, if (n>1) then "s" else "" end) end unless _operands.any? { |o| o.is_template? } @idltype = self.class.suite_type(*(_operands.collect{|o| o.idltype.resolved_type})) @value = calculate(*(_operands.collect{|o| o.value})) else @idltype = nil @value = nil end @operands = _operands self.set_type end
def instantiate(_context)
def instantiate(_context) self.is_template? ? self.class.new(*@operands.collect { |o| o.instantiate(_context) }) : self end
def is_template?
def is_template? @operands.any? { |o| o.is_template? } end
def set_type
def set_type end