diff options
author | thing1 <thing1@seacrossedlovers.xyz> | 2025-03-14 17:37:27 +0000 |
---|---|---|
committer | thing1 <thing1@seacrossedlovers.xyz> | 2025-03-14 17:37:27 +0000 |
commit | af780dc32cbc9d9a40bec1e2ea538e71001c36aa (patch) | |
tree | 6e1386faa63125ba5537e923b933868699df3156 /types.h |
Diffstat (limited to 'types.h')
-rw-r--r-- | types.h | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -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 |