Experimenting with tokenizing strings. This commit just focuses on splitting strings up by whitespace.

This commit is contained in:
2022-01-20 18:17:58 +00:00
parent 479dc57ea8
commit 99ebd82996
3 changed files with 203 additions and 22 deletions
+33
View File
@@ -0,0 +1,33 @@
#ifndef TOKENIZER_H
#define TOKENIZER_H
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "list.h"
typedef enum {
TK_Add,
TK_Sub,
TK_Mul,
TK_Div,
TK_Power,
TK_LParam,
TK_RParam,
TK_Comma,
TK_LBracket,
TK_RBracket,
TK_Colon,
TK_Text,
TK_Number,
TK_Invalid
} TokenType;
typedef struct {
TokenType type;
char* value;
} Token;
List* TokenizeString(const char *);
#endif