diff options
Diffstat (limited to 'comp/work/42/torpn')
-rw-r--r-- | comp/work/42/torpn/torpn.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/comp/work/42/torpn/torpn.c b/comp/work/42/torpn/torpn.c new file mode 100644 index 0000000..58b939a --- /dev/null +++ b/comp/work/42/torpn/torpn.c @@ -0,0 +1,29 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +typedef enum op { + ADD = '+', + SUB = '-', + MUL = '*', + DIV = '/', +} op; + +typedef struct ast { + op o; + int val1; + struct ast *child1; + + int val2; + struct ast *child2; +} ast; + +int main(){ + FILE *f = fopen("test.in", "r"); + char *expr = malloc(256); + fgets(expr, 256, f); + + for (int i = 0; i < strlen(expr); i++){ + + } +} |