From 711eb1d91832267bdd1fe2bc57eeebba9e637c52 Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Wed, 20 Nov 2024 21:11:38 -0800 Subject: init --- src/parse.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/parse.c (limited to 'src/parse.c') 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 +#include +#include + +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, -- cgit v1.2.3-70-g09d2