Esempio n. 1
0
char* Make(ListExecutor* self, SlimList* instruction) {
	char* instanceName = SlimList_GetStringAt(instruction, 2);
	char* className = SlimList_GetStringAt(instruction, 3);
	SlimList* args = SlimList_GetTailAt(instruction, 4);
	char * result = buyString(StatementExecutor_Make(self->executor, instanceName, className, args));
	SlimList_Destroy(args);
	return result;
}
Esempio n. 2
0
char* Call(ListExecutor* self, SlimList* instruction) {
	if (SlimList_GetLength(instruction) < 4)
		return MalformedInstruction(self, instruction);
	char* instanceName = SlimList_GetStringAt(instruction, 2);
	char* methodName = SlimList_GetStringAt(instruction, 3);
	SlimList* args = SlimList_GetTailAt(instruction, 4);
		
	char* result = buyString(StatementExecutor_Call(self->executor, instanceName, methodName, args));
	SlimList_Destroy(args);
	return result;
}
Esempio n. 3
0
char* CallAndAssign(ListExecutor* self, SlimList* instruction) {
	if (SlimList_GetLength(instruction) < 5)
		return MalformedInstruction(self, instruction);
	char* symbolName = SlimList_GetStringAt(instruction, 2);
	char* instanceName = SlimList_GetStringAt(instruction, 3);
	char* methodName = SlimList_GetStringAt(instruction, 4);
	SlimList* args = SlimList_GetTailAt(instruction, 5);
		
	char* result = CSlim_BuyString(StatementExecutor_Call(self->executor, instanceName, methodName, args));
	StatementExecutor_SetSymbol(self->executor, symbolName, result);
	SlimList_Destroy(args);
	return result;
}