Backup, Decl,Type parsing enum,structs etc.
This commit is contained in:
15
parser.h
15
parser.h
@@ -1,17 +1,27 @@
|
||||
#pragma once
|
||||
typedef struct Type Type;
|
||||
typedef struct Expr Expr;
|
||||
typedef struct Decl Decl;
|
||||
typedef struct Parser_Error Parser_Error;
|
||||
|
||||
typedef enum Symbol_Kind{
|
||||
SK_None,
|
||||
SK_Type,
|
||||
SK_Const,
|
||||
SK_Decl,
|
||||
}Symbol_Kind;
|
||||
|
||||
typedef struct Symbol{
|
||||
Symbol_Kind kind;
|
||||
Intern_String string;
|
||||
Token *token;
|
||||
struct{
|
||||
Type *type;
|
||||
struct{
|
||||
Type *type;
|
||||
Expr *expr;
|
||||
} const_val;
|
||||
Decl *decl;
|
||||
};
|
||||
}Symbol;
|
||||
|
||||
@@ -26,9 +36,12 @@ typedef struct Parser{
|
||||
Arena intern_table_arena;
|
||||
Arena symbol_table_arena;
|
||||
|
||||
S64 symbols_inserted;
|
||||
Symbol *symbols;
|
||||
S64 symbols_count;
|
||||
|
||||
S64 interns_in_bytes;
|
||||
S64 interns_inserted;
|
||||
Intern_String *interns;
|
||||
S64 interns_count;
|
||||
|
||||
@@ -43,4 +56,4 @@ typedef struct Parser{
|
||||
|
||||
function Intern_String intern_string(Parser *p, String string);
|
||||
function void type_insert(Parser *p, Type *type, Intern_String string);
|
||||
|
||||
function Token *token_get(Parser *p);
|
||||
|
||||
Reference in New Issue
Block a user