Added lists of tokens and keywords, ready for use

This commit is contained in:
2024-05-20 02:35:19 +10:00
parent 607dc2c22a
commit 0b8bf4119f
9 changed files with 223 additions and 4 deletions

15
source/toy_keywords.h Normal file
View File

@@ -0,0 +1,15 @@
#pragma once
#include "toy_token_types.h"
#include "toy_common.h"
typedef struct {
const Toy_TokenType type;
const char* keyword;
} Toy_KeywordTypeTuple;
extern const Toy_KeywordTypeTuple Toy_private_keywords[];
//access
const char* Toy_private_findKeywordByType(const Toy_TokenType type);
Toy_TokenType Toy_private_findTypeByKeyword(const char* keyword);