diff options
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++; + } +} |