added more grammar; added testing

This commit is contained in:
Ian Griffin
2023-05-29 16:38:56 +08:00
parent 8e1335eb4e
commit 3ff54b86e9
4 changed files with 20 additions and 11 deletions

View File

@@ -3,7 +3,8 @@ LEX_BIN ?= flex
YACC_BIN ?= bison
GRAMMARS_DIR ?= ./grammars
GRAMMAR_ID ?= quut
GRAMMAR_ID ?= lysator
SAMPLES_DIR ?= ./samples
output ?= $(GRAMMAR_ID)-cocc
all: $(output)
@@ -19,3 +20,6 @@ $(output): lex.yy.c $(GRAMMAR_ID).tab.c $(GRAMMAR_ID).tab.h
clean:
rm -f lex.yy.c *.tab.c *.tab.h *-cocc
test: $(SAMPLES_DIR) $(output)
for cfile in $(SAMPLES_DIR)/*; do printf "\n\n *** file: %s *** \n" $$cfile; ./$(output) < $$cfile; [ -eq $$? 0 ]; done