wraith-lang/compiler.c

29 lines
446 B
C

#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;
}