From 5bc170c54464a786136c1d7c0aefe732cd79dd14 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 1 Aug 2018 23:42:14 +1200 Subject: Rename simulator This project has had a name for a while now --- .gitignore | 2 +- Makefile | 6 +++--- hence.c | 35 +++++++++++++++++++++++++++++++++++ simulator.c | 35 ----------------------------------- test/run-lang-tests.sh | 2 +- 5 files changed, 40 insertions(+), 40 deletions(-) create mode 100644 hence.c delete mode 100644 simulator.c diff --git a/.gitignore b/.gitignore index 6551343..224163b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ *.o -simulator +hence parser *.swp diff --git a/Makefile b/Makefile index 3c48b8b..f77bc2b 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,15 @@ CFLAGS += -std=c99 -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200809L -Wall -Wextra -all: simulator +all: hence -simulator: simulator.o common.o gate.o logic.o lex.o parse.o +hence: hence.o common.o gate.o logic.o lex.o parse.o .PHONY: test test: all $(MAKE) -C test all test clean: - rm -f parser simulator + rm -f hence rm -f *.o full-clean: clean 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 +#include + +//#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; +} diff --git a/simulator.c b/simulator.c deleted file mode 100644 index b9f69bd..0000000 --- a/simulator.c +++ /dev/null @@ -1,35 +0,0 @@ -#include -#include - -//#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; -} diff --git a/test/run-lang-tests.sh b/test/run-lang-tests.sh index 5cc68b3..767fde9 100755 --- a/test/run-lang-tests.sh +++ b/test/run-lang-tests.sh @@ -1,7 +1,7 @@ #!/bin/bash cd "$(dirname $0)" -EXECUTABLE="$PWD/../simulator" +EXECUTABLE="$PWD/../hence" echo $PWD -- cgit v1.1