diff --git a/util.c b/util.c index 54d2e36d3daf1b67251f243dd4ecbb4661d244d9..7fac6839969308df69f257ca46a42cb9b16814d3 100644 --- a/util.c +++ b/util.c @@ -129,6 +129,30 @@ cons_cell* create_table(char *table) { return create_cons_cell_w_atom(operator, table_cons); } +cons_cell* create_term(char *term) { + cons_cell* term_cons = create_cons_cell_w_atom(term, NULL); + char operator[4] = "TERM"; + return create_cons_cell_w_atom(operator, term_cons); +} + +cons_cell* create_col(char *col) { + cons_cell* col_cons = create_cons_cell_w_atom(col, NULL); + char operator[3] = "COL"; + return create_cons_cell_w_atom(operator, col_cons); +} + +cons_cell* create_attr(char *attr) { + cons_cell* attr_cons = create_cons_cell_w_atom(attr, NULL); + char operator[4] = "attr"; + return create_cons_cell_w_atom(operator, attr_cons); +} + +cons_cell* create_var(char *var) { + cons_cell* var_cons = create_cons_cell_w_atom(var, NULL); + char operator[4] = "var"; + return create_cons_cell_w_atom(operator, var_cons); +} + const char *node_types[] = {"program", "id", "query", "select_query", "body", "table path", "union_query", "select list", "attrpath", "operator", "bool", "pred"};