diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2023-11-26 16:24:34 -0500 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2023-11-26 16:24:34 -0500 |
commit | 5e95512faaf00c4de6b32770080de7e8d4210e62 (patch) | |
tree | c323efcf3f54b843998c35247e9172333299f074 | |
parent | 2ac6807d25e6f5696dcf0e7b2e360e99286863a5 (diff) |
Token struct
-rw-r--r-- | compiler.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -358,6 +358,31 @@ typedef struct { // Whatev +// Tokenizer +typedef struct { + char *data; + int line, col; + int type; +} Token; + +#define TT_DEFWORD 0 +#define TT_KEYWORD 1 +#define TT_KEYTYPE 2 +#define TT_LITERAL 3 +#define TT_AUGMENT 4 +#define TT_DELIMIT 5 +#define TT_SPLITTR 6 + +char *KEYWORDS = "module,export,asm,if,else,loop,label,goto,continue,break,return,import,as,using,struct,method,interface,implements,operator,len,is"; +char *KEYTYPES = "uint8,uint16,uint32,uint64,uint,int8,int16,int32,int64,int,float32,float64,float,comp64,comp,bool,vect,void,type"; +char *RESERVED = "~`!@#$%^&*()[]{}+-=\"\'\\|:;/?>.<,"; +char *MULTI_DELIMS = ";:#"; + +int token_type(char*data) { + return TT_DEFWORD; +} + + void help() { printf("\n"); printf("Usage:\n"); |