Fix Warnings
[satune.git] / src / AST / table.c
index e89d72ad94fa001918b2da83e090e0bbefe31c3e..9798d13562aa05f3a922629ee3c88871b94e886c 100644 (file)
@@ -1 +1,21 @@
 #include "table.h"
+#include "common.h"
+#include "structs.h"
+#include "tableentry.h"
+
+
+Table * allocTable(Set **domains, uint numDomain, Set * range){
+    Table* table = (Table*) ourmalloc(sizeof(Table));
+    table->domains = allocDefVectorSet();
+    for(int i=0; i<numDomain; i++){
+        pushVectorSet(table->domains, domains[i]);
+    }
+    table->range =range;
+               return table;
+}
+
+void addNewTableEntry(Table* table, uint64_t* inputs, uint inputSize, uint64_t result){
+    ASSERT(getSizeVectorSet( table->domains) == inputSize);
+    pushVectorTableEntry(table->entries, allocTableEntry(inputs, inputSize, result));
+}
+