aboutsummaryrefslogtreecommitdiff
path: root/scope.h
diff options
context:
space:
mode:
Diffstat (limited to 'scope.h')
-rw-r--r--scope.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/scope.h b/scope.h
new file mode 100644
index 0000000..0a07a26
--- /dev/null
+++ b/scope.h
@@ -0,0 +1,27 @@
+#ifndef SCOPE_H
+#define SCOPE_H
+
+#define HASH_SIZE 211
+
+typedef struct hash {
+ node* table[HASH_SIZE];
+ struct hash *prev;
+ node* ret_var;
+} scope;
+
+scope* mkscope();
+void free_scope(scope*);
+
+/*stack routines*/
+void pop_scope(scope**);
+void push_scope(scope**);
+
+/*helpers*/
+node* scope_insert(scope*, char*);
+node* scope_search_all(scope*, char*);
+node* scope_search(scope*, char*);
+node* scope_safe_search_all(scope*, char*);
+
+/*hash function*/
+int hashpjw(char*);
+#endif