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 /cc.c |
Diffstat (limited to 'cc.c')
-rw-r--r-- | cc.c | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -0,0 +1,33 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "lex.h" +#include "parse.h" +#include "types.h" + +int main() { + FILE *f = fopen("test.c", "r"); + + lexobj lexes[4096]; + int lexcount = 0; + + char *line = malloc(256); + while (fgets(line, 256, f) != NULL) { + stripwhitespace(line); + while (line[0] != 0) { + lexes[lexcount] = lex(line); + lexcount++; + line = saveptr; + } + char *line = malloc(256); + } + + ast exprs[4096]; + int exprcount; + + while (lexcount > 0) { + exprs[exprcount] = genast(lexes, &lexcount); + exprcount++; + } +} |