main.c 971 Bytes
Newer Older
Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
1
2

#include <stdio.h>
3
#include <string.h>
Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
4
5

#include "mem.h"
6
#include "desc.h"
7
#include "prim.h"
Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
8
#include "parse.h"
9
#include "code.h"
Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
10
11
12
13

int main()
{   
	init_mem();
14
	init_desc();
15
	init_prim();
16
	
17
18
	//char* funstream = "40 R10 example._R2 1 9 example.a9 example.b37 F12 example.g_482 3 AF3 add2 VA0 VA1 39 C9 example.fAF12 example.g_482 LI1 LI2 55 F13 example.Start0 0 AF10 example._R2 LI1 VF9 example.f29 F4 main0 0 VF13 example.Start";
	char* funstream = "25 F13 example.Start0 0 LI1 29 F4 main0 0 VF13 example.Start";
19
		
20
	int nrfuns = parse(&funstream, strlen(funstream));
21
		
22
23
24
25
	printf("Number of functions parsed: %d\n", nrfuns);	
		
	// TODO: put it into a special "expression" space, instead of "code"

26
	char *exprstream = "VF13 example.Start";
27
28
29
30
31
32
	
	Code* expr = parseTerm(&exprstream);	
	Thunk* res = exec(expr);
	
	print(res);
	
Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
33
//   add_fun("jimbo", (Desc*) "artist");
Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
34
35
36
//   char *tval = (char*) find_fun("jimbo");
//   printf ("shortcut tval for jimbo = %s\n", tval);   
}