aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorc+12023-05-03 10:23:35 -0400
committerc+12023-05-03 10:23:35 -0400
commit9d981a2597dca067572ee16d1a3f6e99f9c6ddd6 (patch)
tree37de867b64491259e2b1dd33330bc234fd0b6eb1 /src/include
parent191c063e6c7332a8558835ce0d4710c3f8ba7de8 (diff)
in which i learn how c structs work
Diffstat (limited to 'src/include')
-rw-r--r--src/include/lexer.h20
-rw-r--r--src/include/main.h0
2 files changed, 20 insertions, 0 deletions
diff --git a/src/include/lexer.h b/src/include/lexer.h
index e69de29..a20bf8c 100644
--- a/src/include/lexer.h
+++ b/src/include/lexer.h
@@ -0,0 +1,20 @@
+#ifndef LEXER_H
+#define LEXER_H
+#include "token.h"
+
+typedef struct LEXER_STRUC {
+ char c; // current character in content
+ unsigned int i; // index of c
+ char* content; // the code itself
+} lexer_T;
+
+lexer_T* lexer_init(char* content);
+void lexer_next(lexer_T* lexer);
+void lexer_pass(lexer_T* lexer);
+token_T* lexer_get_next_token(lexer_T* lexer);
+token_T* lexer_get_string(lexer_T* lexer);
+token_T* lexer_get_id(lexer_T* lexer);
+token_T* lexer_next_token(lexer_T* lexer, token_T* token);
+char* lexer_get_c_as_string(lexer_T* lexer);
+
+#endif
diff --git a/src/include/main.h b/src/include/main.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/include/main.h