summaryrefslogtreecommitdiff
path: root/ast.h
diff options
context:
space:
mode:
authorTom Harley2020-02-26 02:33:42 +0000
committerTom Harley2020-02-26 02:33:42 +0000
commit7808807313b33dee301b2eff5cb749147dd47ae0 (patch)
tree618375061123c858c638416aa78f1583850f85af /ast.h
downloadsheets-7808807313b33dee301b2eff5cb749147dd47ae0.tar.gz
sheets-7808807313b33dee301b2eff5cb749147dd47ae0.zip

Initial commit

HEADmaster
Diffstat (limited to 'ast.h')
-rw-r--r--ast.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/ast.h b/ast.h
new file mode 100644
index 0000000..f7ac254
--- /dev/null
+++ b/ast.h
@@ -0,0 +1,22 @@
+#define PAIR 0
+
+typedef struct ast {
+ int type;
+
+ union {
+ long i;
+ char *s;
+ double f;
+ struct {
+ struct ast *l;
+ struct ast *r;
+ } p;
+ } c;
+} ast;
+
+ast *new_pair(ast *l, ast *r);
+ast *new_int(char *s);
+ast *new_float(char *s);
+ast *new_id(char *id);
+
+void free_ast(ast *n);