Backup, Decl,Type parsing enum,structs etc.

This commit is contained in:
Krzosa Karol
2022-04-29 23:28:41 +02:00
parent 9cbbb4d616
commit a5a3acf3ef
12 changed files with 407 additions and 45 deletions

View File

@@ -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);