-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalyzer.h
66 lines (53 loc) · 1.19 KB
/
analyzer.h
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef ANALYSE_H
#define ANALYSE_H
// -------------------- SymInfo
typedef struct {
intptr ident;
intptr type;
int ptrlvl;
Bool cst;
} SymInfo;
// -------------------- Analyze context
typedef struct {
SModSign *sign;
SModImpl *impl;
} AnalyzeCtx;
// -------------------- System types
typedef enum {
// Boolean
BOOL,
// Unsigned
U8,
U16,
U32,
U64,
U128,
// Signed
I8,
I16,
I32,
I64,
I128,
// Float
F32,
F64,
// Always last.
NLANGTYPE,
} LangType;
extern const char* langtypestrs[NLANGTYPE];
// -------------------- Functions
void printsymbols(FILE* fd, Symbols *syms);
void printsymbolsinfo(FILE* fd, int nsym);
void printstmtarray(FILE *fd, StmtArray *array);
Bool ispub(const StmtArray *pubsym, const intptr ident, const EStmt *kind);
Bool analyseimport(StmtArray *imports);
Bool analyzetype(SStruct *stmt);
Bool analyzeglobalcst(SDecl *decl, int nelem);
Bool analyzefun(AnalyzeCtx *ctx, SFun *fun, intptr stmt, int nsym);
Bool analyzemodsign(SModSign *sign);
Bool analyzemodimpl(SModImpl *impl);
Bool analyzemodskel(SModSkel *skel);
Bool analyzemoddef(SModDef *def);
Bool analyzepub(StmtArray *pubsym);
Symbol* searchtopdcl(Symbols *syms, intptr ident);
#endif /* ANALYSE_H */