summaryrefslogtreecommitdiff
path: root/src/genjsbind.c
blob: 150c780a77bafa9e2ccf4d0245278f415f7a79f5 (plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <stdio.h>

#include "webidl-ast.h"

#include "webidl-parser.h"
#include "genbind-parser.h"

extern int webidl_debug;
extern FILE* webidl_in;
extern int webidl_parse();

extern int genbind_debug;
extern FILE* genbind_in;
extern int genbind_parse();

int loadwebidl(char *filename)
{
	FILE *myfile = fopen(filename, "r");
	if (!myfile) {
		perror(filename);
		return 2;
	}
	/* set flex to read from file */
	webidl_in = myfile;

	webidl_debug = 1;
	
	/* parse through the input until there is no more: */
	while (!feof(webidl_in)) {
		webidl_parse();
	}
	return 0;
}

int main(int argc, char **argv)
{
	FILE *myfile = fopen("htmldocument.bnd", "r");
	if (!myfile) {
		perror(NULL);
		return 2;
	}
	/* set flex to read from file */
	genbind_in = myfile;

	genbind_debug = 1;
	
	/* parse through the input until there is no more: */
	while (!feof(genbind_in)) {
		genbind_parse();
	}
	return 0;
}