예제 #1
0
  std::string ListExecutor::Dispatch(SlimList* instruction) 
  {
    std::string command = instruction->GetStringAt(1);
    boost::algorithm::to_lower(command);
    auto it = m_cmdTable.find(command);
    if (it != m_cmdTable.end())
    {
      return it->second(instruction);
    }

    return InvalidCommand(instruction);
  }
예제 #2
0
char* Dispatch(ListExecutor* self, SlimList* instruction) {
	char* command = SlimList_GetStringAt(instruction, 1);
	if (strcmp(command, "import") == 0)
		return Import(self, instruction);
	else if (strcmp(command, "make") == 0)
		return Make(self, instruction);
	else if (strcmp(command, "call") == 0)
		return Call(self, instruction);
	else if (strcmp(command, "callAndAssign") == 0)
		return CallAndAssign(self, instruction);
	else 
		return InvalidCommand(self, instruction);
}