void AbstractInstructionWithParams::finalize() { if (params.size() == 2) { std::list<std::string>::iterator iter = params.begin(); OperandFactory * factory = AbstractVM::getInstance()->getOperandFactory(); std::string type = *iter; iter++; std::string value = *iter; operand = factory->createOperand(factory->retrieveFromString(type), value); return; } throw BadParamException(); }
void Instruction::AInstructionParams::end() { std::list<std::string>::iterator it; OperandFactory *factory; eOperandType type; std::string str_type; std::string str_value; if (this->params.size() == 2) { it = this->params.begin(); factory = AbstractVM::getVM()->getOperandFactory(); str_type = *it; it++; str_value = *it; type = factory->getTypeFromString(str_type); this->op = factory->createOperand(type, str_value); return ; } throw WrongParameterException("wrong parameters"); }
OperandFactory::OperandFactory(const OperandFactory &factory) : _stringFunctions(factory.get_stringFunctions()), _numberFunctions(factory.get_numberFunctions()), _names(factory.get_names()) {}