astg.h (275B)
1 typedef struct ast_node ast_node; 2 3 typedef enum op { 4 ADD = 0, 5 SUB = 1, 6 MUL = 2, 7 DIV = 3, 8 } op; 9 10 typedef struct ast_node { 11 op operation; 12 int realLeft; 13 int realRight; 14 ast_node *right; 15 ast_node *left; 16 } ast_node; 17 18 int exec(ast_node *exp); 19 void freeAst(ast_node *head);