summaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
authorthing1 <thing1@seacrossedlovers.xyz>2025-03-14 17:37:27 +0000
committerthing1 <thing1@seacrossedlovers.xyz>2025-03-14 17:37:27 +0000
commitaf780dc32cbc9d9a40bec1e2ea538e71001c36aa (patch)
tree6e1386faa63125ba5537e923b933868699df3156 /types.h
init commitHEADmaster
Diffstat (limited to 'types.h')
-rw-r--r--types.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/types.h b/types.h
new file mode 100644
index 0000000..75aa773
--- /dev/null
+++ b/types.h
@@ -0,0 +1,43 @@
+#ifndef __TYPES_H_
+#define __TYPES_H_
+
+typedef enum parsetypes {
+ NILPARSETYPE,
+ FUNCTIONDEF,
+ FUNCEND,
+ MATHEXPR,
+ MEMEXPR,
+ KEYWORDEXPR,
+} parsetypes;
+
+typedef enum lextypes {
+ NILLEXTYPE,
+ INTLIT,
+ KEYWORD,
+ NAME,
+ OPENCURLY = '{',
+ CLOSECURLY = '}',
+ OPENBRACE = '(',
+ CLOSEBRACE = ')',
+ SEMICOLON = ';',
+ ADD = '+',
+ SUB = '-',
+ DIV = '/',
+ MUL = '*',
+} lextypes;
+
+typedef struct lexobj {
+ lextypes t;
+ char *data;
+} lexobj;
+
+typedef struct ast {
+ char *function;
+ int childcount;
+ union {
+ struct ast *children[8];
+ char *litteralchildren[8];
+ };
+} ast;
+
+#endif