wraith-lang/compiler.c

29 lines
446 B
C
Raw Normal View History

2021-04-18 22:29:54 +00:00
#include <stdio.h>
#include <llvm-c/Core.h>
#include "y.tab.h"
#include "stack.h"
extern FILE *yyin;
Stack *stack;
int main(int argc, char *argv[])
{
if (argc < 2)
{
printf("Please provide a file.\n");
return 1;
}
stack = CreateStack();
FILE *fp = fopen(argv[1], "r");
yyin = fp;
yyparse(fp, stack);
fclose(fp);
LLVMModuleRef mod = LLVMModuleCreateWithName("my_module");
return 0;
}