summaryrefslogtreecommitdiff
path: root/simulator.c
diff options
context:
space:
mode:
Diffstat (limited to 'simulator.c')
-rw-r--r--simulator.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/simulator.c b/simulator.c
index fb5ce8f..4f99c4f 100644
--- a/simulator.c
+++ b/simulator.c
@@ -1,29 +1,24 @@
#include <stdio.h>
#include <string.h>
-#include "gate.h"
-#include "logic.h"
+//#include "gate.h"
+//#include "logic.h"
+#include "lexer.h"
#include "parser.h"
int main(int argc, char **argv) {
- char buf[4096];
- FILE *fd = stdin;
-
(void)argc;
(void)argv;
- gate_init();
+// gate_init();
- while (NULL != fgets(buf, sizeof(buf), fd)) {
- if (parse_line(buf)) {
- return 1;
- }
- }
+ struct token *tok = lex_file(stdin);
+ int p = parse(tok);
- gate_set_input("a", LOGIC_LOW);
- gate_set_input("b", LOGIC_LOW);
- gate_update();
- gate_dump();
+// gate_set_input("a", LOGIC_LOW);
+// gate_set_input("b", LOGIC_LOW);
+// gate_update();
+// gate_dump();
return 0;
}