aboutsummaryrefslogtreecommitdiff
path: root/src/as_analyzer.h
blob: 58a9203e13091682b57094d973038ca1a3e75da6 (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
#ifndef FVM_AS_ANALYZER_H_
#define FVM_AS_ANALYZER_H_

#include "as_parser.h"
#include "utils.h"

struct sym_table_entry {
    const char * name;
    size_t offset;
};
typedef struct sym_table_entry sym_table_entry;

struct sym_table {
    int size;
    int cap;
    struct sym_table_entry *buf;
};
typedef struct sym_table sym_table;

sym_table new_sym_table(allocator* alct);
void sym_table_add(allocator* alct, sym_table* tbl, const char* name, int pos);

sym_table analyze_prog(allocator* alct, prog* prog);

#endif // FVM_AS_ANALYZER_H_