Parsing exprs, enum_decls, Introduce intern table, symbol table
This commit is contained in:
63
decl.h
Normal file
63
decl.h
Normal file
@@ -0,0 +1,63 @@
|
||||
#pragma once
|
||||
typedef struct Note Note;
|
||||
typedef struct Decl Decl;
|
||||
typedef struct Decl_Enum_Child Decl_Enum_Child;
|
||||
|
||||
typedef enum Decl_Kind{
|
||||
DK_None,
|
||||
DK_Variable,
|
||||
DK_Typedef,
|
||||
DK_Struct,
|
||||
DK_Union,
|
||||
DK_Enum,
|
||||
DK_Function,
|
||||
}Decl_Kind;
|
||||
|
||||
struct Note{
|
||||
Intern_String string;
|
||||
Token *token;
|
||||
Expr *expr;
|
||||
|
||||
Note *next;
|
||||
Note *first;
|
||||
Note *last;
|
||||
};
|
||||
|
||||
struct Decl_Enum_Child{
|
||||
Decl_Enum_Child *next;
|
||||
Token *token; // name
|
||||
Expr *expr;
|
||||
};
|
||||
|
||||
struct Decl{
|
||||
Decl_Kind kind;
|
||||
Decl *next;
|
||||
Intern_String name;
|
||||
Token *token;
|
||||
|
||||
Note *first_note;
|
||||
Note *last_note;
|
||||
union{
|
||||
struct{
|
||||
Decl_Enum_Child *first;
|
||||
Decl_Enum_Child *last;
|
||||
} enum_val;
|
||||
struct{
|
||||
Decl *first;
|
||||
Decl *last;
|
||||
} aggregate_val;
|
||||
struct{
|
||||
Decl *first;
|
||||
Decl *last;
|
||||
Type *return_type;
|
||||
}func_val;
|
||||
struct{
|
||||
Type *type;
|
||||
Expr *expr;
|
||||
}var_val;
|
||||
struct{
|
||||
Type *type;
|
||||
}typedef_val;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user