aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavian Kaufmann <flavian@flaviankaufmann.ch>2025-05-20 07:24:21 +0200
committerFlavian Kaufmann <flavian@flaviankaufmann.ch>2025-05-20 07:24:21 +0200
commitee64135583d5ba02b57cd520bb50ca8819d37bff (patch)
tree16c27dbc494fcb7ee1f49398545967034eb662bc
parent98be4ba8e6050f33fd47786de066b165f74a115d (diff)
downloadimp-ee64135583d5ba02b57cd520bb50ca8819d37bff.tar.gz
imp-ee64135583d5ba02b57cd520bb50ca8819d37bff.zip
README.md
-rw-r--r--.gitignore1
-rw-r--r--Makefile5
-rw-r--r--README.md14
3 files changed, 19 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c795b05
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+build \ No newline at end of file
diff --git a/Makefile b/Makefile
index 33bf25d..b20c925 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ OBJS := $(BUILD_DIR)/parser.tab.o $(BUILD_DIR)/lex.yy.o $(BUILD_DIR)/driver
TARGET := $(BUILD_DIR)/imp
-.PHONY: all clean
+.PHONY: all clean run
all: $(TARGET)
@@ -46,6 +46,9 @@ $(BUILD_DIR)/driver.o: $(DRIVER_C) $(PARSER_H) $(AST_H) | $(BUILD_DIR)
$(BUILD_DIR)/ast.o: $(AST_C) $(AST_H) | $(BUILD_DIR)
$(CC) $(CFLAGS) -c $(AST_C) -o $@
+run: $(TARGET)
+ ./$(TARGET) example.imp
+
clean:
rm -rf $(BUILD_DIR)
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..b05b025
--- /dev/null
+++ b/README.md
@@ -0,0 +1,14 @@
+# IMP Interpreter
+
+A small interpreter of the IMP programming language.
+
+# Build
+
+- `make all` to build interpreter.
+- `make run` to interpret "example.imp".
+- `make clean` to remove build folder.
+
+## Dependencies
+
+- [flex](https://github.com/westes/flex)
+- [bison](https://www.gnu.org/software/bison) \ No newline at end of file