summaryrefslogtreecommitdiff
path: root/comp/work/42/torpn/torpn.c
blob: 58b939adf909cc2f9f377a208f5c9f3831bd2877 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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++){

	}
}