summaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'types.h')
-rw-r--r--types.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/types.h b/types.h
new file mode 100644
index 0000000..7645feb
--- /dev/null
+++ b/types.h
@@ -0,0 +1,38 @@
+#ifndef __types_h_
+#define __types_h_
+#include <stdbool.h>
+#include <stdlib.h>
+
+#define MAXASS 4096
+
+#define MAXARG 12
+
+typedef struct ast ast;
+typedef struct values values;
+
+typedef enum type {
+ FUN,
+ INT,
+
+} type;
+
+typedef struct ast {
+ char *fname;
+ values *vals;
+} ast;
+
+typedef struct values {
+ int argc;
+ type ts[MAXARG];
+ union {
+ int is[MAXARG];
+ ast *as[MAXARG];
+ };
+} values;
+
+ast *newast(char *fname);
+values *newastval(ast *a);
+values *newintval(int i);
+values *addval(values *vs, values *v);
+
+#endif