41 lines
768 B
C
41 lines
768 B
C
#ifndef RES_H
|
|
#define RES_H
|
|
|
|
#include "ast.h"
|
|
#include "collection.h"
|
|
|
|
typedef enum {
|
|
OldSym_Typedef,
|
|
OldSym_Declarator,
|
|
} OldSymTy;
|
|
|
|
typedef struct {
|
|
OldSymTy ty;
|
|
union {
|
|
struct {
|
|
AstStmt* stmt;
|
|
AstDeclar* declar;
|
|
} declarator;
|
|
};
|
|
} OldSym;
|
|
|
|
typedef struct OldSyms OldSyms;
|
|
|
|
OldSyms* oldsyms_new();
|
|
void oldsyms_free(OldSyms* s);
|
|
|
|
void oldsyms_push_scope(OldSyms* s);
|
|
void oldsyms_pop_scope(OldSyms* s);
|
|
|
|
void oldsyms_define(OldSyms* s, const char* ident, OldSym* sym);
|
|
OldSym* oldsyms_get(OldSyms* s, const char* ident);
|
|
|
|
typedef struct Resolver Resolver;
|
|
|
|
Resolver* oldresolver_new(Arena* arena);
|
|
void oldresolver_free(Resolver* r);
|
|
|
|
void oldresolver_resolve_top_stmt(Resolver* r, AstStmt* stmt);
|
|
|
|
#endif
|