#include "logic.h" /* Author: xerox Date: 1/19/2020 creates logic given type, statement list to execute, and variable name for condition. */ static logic* create_logic(logic_type type, node_info* stmt_list, char* var_name) { logic* new_logic = malloc(sizeof(logic)); if (!new_logic || !stmt_list || !var_name) return NULL; memset(new_logic, NULL, sizeof(*new_logic)); new_logic->type = type; new_logic->condition_var = var_name; new_logic->stmt_list = stmt_list; return new_logic; }