Files
jailbasic/main.cpp

21 lines
438 B
C++

#include "parser.h"
#include <stdio.h>
#include <stdlib.h>
static unsigned char mem[65536];
int main(void) {
FILE *f = fopen("test.vb", "rb");
fseek(f, 0, SEEK_END);
long fsize = ftell(f);
fseek(f, 0, SEEK_SET); //same as rewind(f);
char *program = (char*)malloc(fsize + 1);
fread(program, fsize, 1, f);
fclose(f);
program[fsize] = 0;
parser_parse(program, mem);
free(program);
return 0;
}