diff --git a/fz/Makefile b/fz/Makefile index ea8c7b0..756fdce 100644 --- a/fz/Makefile +++ b/fz/Makefile @@ -9,7 +9,9 @@ PLOFILES = $(patsubst %.pl,%.o,$(PLFILES)) # XXX/output.pl produces fz-XXX, the flatzinc-to-XXX compiler FZBACKS = $(patsubst %/output.pl,%,$(wildcard */output.pl)) FZSEM = $(patsubst %/output.pl,fz-%,$(wildcard */output.pl)) -FZOFILES = $(patsubst %,%/*.o,$(FZBACKS)) +FZPLFILES = $(foreach B,$(FZBACKS),$(wildcard $B/*.pl)) +FZOFILES = $(patsubst %.pl,%.o,$(FZPLFILES)) +FZAFILES = $(patsubst %,lib%.a,$(FZBACKS)) # NOTE: we need to pass the `-l' flag to ensure the scanner internal # variable `yylineno' is available. @@ -31,28 +33,34 @@ RM = /bin/rm -f %.ast:: %.fzn fzp < $< > $@ -all: fzp $(FZSEM) $(PLOFILES) $(FZOFILES) +all: fzp $(FZSEM) $(PLOFILES) $(FZOFILES) $(FZAFILES) fzp: $(OBJ) $(CC) $(CFLAGS) -o $@ $(OBJ) $(LEXLIB) -fz-%: %/output.o $(PLOFILES) +fz-%: $(PLOFILES) lib%.a $(GPLC) -o $@ $+ +lib%.a: $(FZOFILES) + ar rv $@ $+ + %.o: %.pl $(GPLC) $(GPLCFLAGS) -c $< flatzinc.tab.c: flatzinc.y lex.yy.c - $(YACC) $(YACCFLAGS) flatzinc.y + $(YACC) $(YACCFLAGS) flatzinc.y lex.yy.c: flatzinc.l - $(LEX) $(LEXFLAGS) flatzinc.l + $(LEX) $(LEXFLAGS) flatzinc.l clean: - $(RM) $(OBJ) $(PLOFILES) $(FZOFILES) $(GENCFILES) $(OTHER) core + $(RM) \ + $(OBJ) $(PLOFILES) \ + $(FZOFILES) $(FZAFILES) \ + $(GENCFILES) $(OTHER) core clobber: clean - $(RM) $(EXE_FILE) + $(RM) $(EXE_FILE) .PHONY: distclean distclean: clobber diff --git a/fz/paccs/coverage.pl b/fz/paccs/coverage.pl new file mode 100644 index 0000000..05d5c1c --- /dev/null +++ b/fz/paccs/coverage.pl @@ -0,0 +1,4 @@ +% == No, Emacs this is -*-Prolog-*- code, not what you thought... ============= + +% == Code coverage for PaCCS ================================================== + diff --git a/fz/paccs/output.pl b/fz/paccs/output.pl index 15a73c8..5463f62 100644 --- a/fz/paccs/output.pl +++ b/fz/paccs/output.pl @@ -92,10 +92,9 @@ cg_constrs(CS, ST) --> cg_coverage(CS, CR, ST), cg_constrs(CR, ST). % emit an instruction which partly covers CI, leaving CO untreated % FIXME: for now this just puts out comments -cg_coverage([], [], _ST) --> []. -cg_coverage([C|CS], [C|CX], ST) --> - { format_to_codes(S, "// ~w\n", [C]) }, S, - cg_coverage(CS, CX, ST). +cg_coverage([C|CS], CS, _ST) --> + { C=constraint(CE, _A), + format_to_codes(S, "// ~w\n", [CE]) }, S. % -- goal --------------------------------------------------------------------- diff --git a/fz/semantic.pl b/fz/semantic.pl index ad3077e..bf7b185 100644 --- a/fz/semantic.pl +++ b/fz/semantic.pl @@ -49,7 +49,7 @@ sa_n(var(N,T,[],A), V, ST) :- !, st_insert(ST, N, V). sa_n(var(N,T,I,A), V, ST) :- % non-empty initializer - sa_n_traverse(I, NI, ST), % parse initializer (& ignore T and A), + sa_n_traverse(I, _NI, ST), % parse initializer (& ignore T and A), sa_attribs(A, AX, ST), V=val(N,T,I,AX), % -- not var(N,T,NI,AX) -- st_insert(ST, N, V). % and it becomes the ST entry value -- libgit2 0.21.2