summaryrefslogtreecommitdiff
path: root/ast.h
blob: f7ac2542f1c73c8ee99669fec99f15419e5f2d32 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);