diff options
author | Kai Stevenson <kai@kaistevenson.com> | 2024-11-20 21:11:38 -0800 |
---|---|---|
committer | Kai Stevenson <kai@kaistevenson.com> | 2024-11-20 21:11:38 -0800 |
commit | 711eb1d91832267bdd1fe2bc57eeebba9e637c52 (patch) | |
tree | 6cbd10ee276f1cb8119d2528cc1f7a04894228de /src/parse.c |
Diffstat (limited to 'src/parse.c')
-rw-r--r-- | src/parse.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/parse.c b/src/parse.c new file mode 100644 index 0000000..10e8b6b --- /dev/null +++ b/src/parse.c @@ -0,0 +1,24 @@ +#include "parse.h" +#include "lexer.h" +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +sym_t parse(tokenSet_t tokens, int* seek) { + token_t token = tokens.tokens[(*seek)++]; + if (token.type == ERR || token.type == EOL) { + exit(1); + } + else if (token.type == NAME) { + return parse_name(seek); + } +} +sym_t parse_name(tokenSet_t tokens, int* seek) { + token_t token = tokens.tokens[(*seek)++]; + if (token.type == KEYWORD) { + if (keyword_is_type(token.value)) { + + } + } +} +sym_t parse_definition(tokenSet_t tokens, int* seek, |