Skip to content
Snippets Groups Projects
Commit 5b9afe05 authored by expan's avatar expan
Browse files

Added term,col,attr,var

parent fd0577e7
No related branches found
No related tags found
1 merge request!1SQLP parser with cons cells
...@@ -129,6 +129,30 @@ cons_cell* create_table(char *table) { ...@@ -129,6 +129,30 @@ cons_cell* create_table(char *table) {
return create_cons_cell_w_atom(operator, table_cons); 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", const char *node_types[] = {"program", "id", "query", "select_query", "body", "table path", "union_query",
"select list", "attrpath", "operator", "bool", "pred"}; "select list", "attrpath", "operator", "bool", "pred"};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment