summaryrefslogtreecommitdiff
path: root/hence.c
blob: b9f69bd7d2726783017d91fa96c99f11c988a4a1 (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
#include <stdio.h>
#include <string.h>

//#include "gate.h"
//#include "logic.h"
#include "lex.h"
#include "parse.h"

int main(int argc, char **argv) {
	FILE *fd = NULL;

	if (argc != 2) {
		fprintf(stderr, "Syntax: %s file.hence\n", argv[0]);
		return 1;
	}

//	gate_init();

	fd = fopen(argv[1], "r");
	
	if (!fd) {
		perror("fopen");
		return 1;
	}

	struct token *tok = lex_file(fd);
	int p = parse(argv[1], fd, tok);

//	gate_set_input("a", LOGIC_LOW);
//	gate_set_input("b", LOGIC_LOW);
//	gate_update();
//	gate_dump();

	return p;
}