You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
497 B

5 years ago
#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;
}