From 7808807313b33dee301b2eff5cb749147dd47ae0 Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Wed, 26 Feb 2020 02:33:42 +0000 Subject: Initial commit --- ast.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ast.h (limited to 'ast.h') 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); -- cgit v1.2.1