Parsing exprs, enum_decls, Introduce intern table, symbol table
This commit is contained in:
46
parser.h
Normal file
46
parser.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#pragma once
|
||||
typedef struct Type Type;
|
||||
typedef struct Parser_Error Parser_Error;
|
||||
|
||||
typedef enum Symbol_Kind{
|
||||
SK_None,
|
||||
SK_Type,
|
||||
}Symbol_Kind;
|
||||
|
||||
typedef struct Symbol{
|
||||
Symbol_Kind kind;
|
||||
Intern_String string;
|
||||
struct{
|
||||
Type *type;
|
||||
};
|
||||
}Symbol;
|
||||
|
||||
struct Parser_Error{
|
||||
Parser_Error *next;
|
||||
String message;
|
||||
Token *token;
|
||||
};
|
||||
|
||||
typedef struct Parser{
|
||||
Arena main_arena;
|
||||
Arena intern_table_arena;
|
||||
Arena symbol_table_arena;
|
||||
|
||||
Symbol *symbols;
|
||||
S64 symbols_count;
|
||||
|
||||
Intern_String *interns;
|
||||
S64 interns_count;
|
||||
|
||||
U8 *first_keyword;
|
||||
U8 *last_keyword;
|
||||
|
||||
Parser_Error *first_error;
|
||||
Parser_Error *last_error;
|
||||
|
||||
Tokens tokens;
|
||||
}Parser;
|
||||
|
||||
function Intern_String intern_string(Parser *p, String string);
|
||||
function void type_insert(Parser *p, Type *type, Intern_String string);
|
||||
|
||||
Reference in New Issue
Block a user