language

Some fools attempt at an interpreted language
Log | Files | Refs

main.c (623B)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdio.h>

#include "proc.h"
#include "rt.h"
#include "is.h"
#include "ins_def.h"
#include "helper.h"

#define DEBUG 0

int main(int argc, char** argv)
{
	ASSERT(argc > 1, "Specify a bytecode file in the first and only argument, please\n");

	init_mdata();                       // Initalize the instruction defs
	init_adata();
	init_ins_def();

	rt_t* runtime = proc_init(argv[1]); // Initalize process

	proc_run(runtime);                  // Execute runtime

	proc_clean(runtime);                // Once `proc_run` returns, clean
	                                    // what sort of mess it made.

	return 0;
}