summaryrefslogtreecommitdiff
path: root/hence.c
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-08-01 23:42:14 +1200
committerDavid Phillips <david@sighup.nz>2018-08-01 23:42:18 +1200
commit5bc170c54464a786136c1d7c0aefe732cd79dd14 (patch)
treee36c6466c890267a62189a18327c9294e8470592 /hence.c
parentd4a083dec30a5ed2732a13d75140a8e51a21598b (diff)
downloadhence-5bc170c54464a786136c1d7c0aefe732cd79dd14.tar.xz
Rename simulator
This project has had a name for a while now
Diffstat (limited to 'hence.c')
-rw-r--r--hence.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/hence.c b/hence.c
new file mode 100644
index 0000000..b9f69bd
--- /dev/null
+++ b/hence.c
@@ -0,0 +1,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;
+}