<commit_before># HACK: Assume nix installation in Makefile

STRS     = $(wildcard src/*.str) \
           $(wildcard src/sdf2imp/*.str) \
           $(wildcard src/sdf2imp/lib/*.str) \
           $(wildcard src/sdf2imp/project/*.str) \
           $(wildcard src/sdf2imp/parser/*.str) \
           $(wildcard src/sdf2imp/util/*.str) \
           $(wildcard src/sdf2imp/services/*.str)           

RTREES = $(STRS:.str=.rtree)

SDFS     = $(wildcard src/syntax/*.sdf)

SYNTAX   = src/syntax/EditorService.tbl src/syntax/EditorService.pp src/syntax/EditorService-pretty.pp.af src/syntax/EditorService.str src/syntax/Stratego-Java-EditorService.tbl

STRCFLAGS = \
	-la stratego-xtc \
    -la stratego-lib \
    -la stratego-gpp \
    -la stratego-tool-doc \
    -la stratego-sglr \
    -la ${HOME}/.nix-profile/lib/libjava-front.la \
    `pkg-config --variable=strcxtcflags strategoxt`

SDFINCLUDES    = -Idef ${HOME}/.nix-profile/share/java-front-syntax/JavaMix.def \
                 -Idef ${HOME}/.nix-profile/share/java-front/JavaEBlockMix.def \
                 -Idef ${HOME}/.nix-profile/share/java-front/EmbeddedJavaMix.def

# I don't care much for nullary constructor warnings unless it's about lowercase ones, such as 'start'
STRCSTFU=2>&1 | grep -vE 'warning ] Nullary constructor .*[A-Z]|warning ] multiple external| \[ExtSDef\(|stratego-trm|module-name-checked|module-name-checked"' \
                 >&2

STRINCLUDES = \
	-I $(HOME)/.nix-profile/share/sdf/xml-front \
	-I $(HOME)/.nix-profile/share/sdf/gpp \
	-I src/syntax \
    `pkg-config --variable=strcflags java-front`

all : sdf2imp src/include/sdf2imp.ctree syntax

check : all \
        tests/EditorService.runtestsuite \
        # tests/test-editor-descriptor.runsh \
        # tests/test-stratego-java.runsh

sdf2imp : $(RTREES) $(SYNTAX) Makefile src/include/rtg.tbl
	strc -i src/sdf2imp.str -o $@ $(STRINCLUDES) $(STRCFLAGS) -m main-sdf2imp $(STRCSTFU)
	rm sdf2imp.c sdf2imp.lo sdf2imp.o

syntax : $(SYNTAX)

clean :
	rm -f src/include/sdf2imp.ctree sdf2imp $(RTREES) $(wildcard src/syntax/*.tbl) $(wildcard src/syntax/*.def) *.dep include/*.dep
	
# files:

% : %.str $(STRS)

%.rtree : %.str $(SYNTAX)
	@parse-stratego -i $< -o $@ $(STRINCLUDES)

src/include/sdf2imp.ctree : sdf2imp
	strc -F --library -i src/sdf2imp.str -o $@ $(STRINCLUDES) $(STRCSTFU)

%.pp : %.def
	ppgen -i $< -o $@

%.pp.af : %.pp
	parse-pp-table -i $< -o $@

%.str : %.rtg
	rtg2sig -i $< -o $@

%.rtg : %.def
	sdf2rtg -i $< -o $@ -m `basename $*` --ignore-missing-cons

%.runtestsuite : %.testsuite
	parse-unit --no-heuristic-filters -i $< -p src/syntax/EditorService.tbl

%.runsh : %.sh
	sh $<

src/syntax/EditorService.def : src/syntax/EditorService.sdf $(SDFS)
	pack-sdf -i $< -o $@ -I src/syntax

src/syntax/EditorService.tbl : src/syntax/EditorService.def
	sdf2table -m EditorService -i $< -o $@

src/syntax/Stratego-Java-EditorService.def : src/syntax/Stratego-Java-EditorService.sdf $(SDFS)
	pack-sdf -i $< -o $@ -I src/syntax $(SDFINCLUDES)

src/syntax/Stratego-Java-EditorService.tbl : src/syntax/Stratego-Java-EditorService.def
	sdf2table -m Stratego-Java-EditorService -i $< -o $@

# We need a better solution for this
src/include/rtg.tbl : ~/.nix-profile/share/sdf/stratego-regular/rtg.tbl
	baf2trm  -i $< -o $@ # cp $< $@
<commit_msg>Make include dir.<commit_after># HACK: Assume nix installation in Makefile

STRS     = $(wildcard src/*.str) \
           $(wildcard src/sdf2imp/*.str) \
           $(wildcard src/sdf2imp/lib/*.str) \
           $(wildcard src/sdf2imp/project/*.str) \
           $(wildcard src/sdf2imp/parser/*.str) \
           $(wildcard src/sdf2imp/util/*.str) \
           $(wildcard src/sdf2imp/services/*.str)           

RTREES = $(STRS:.str=.rtree)

SDFS     = $(wildcard src/syntax/*.sdf)

SYNTAX   = src/syntax/EditorService.tbl src/syntax/EditorService.pp src/syntax/EditorService-pretty.pp.af src/syntax/EditorService.str src/syntax/Stratego-Java-EditorService.tbl

STRCFLAGS = \
	-la stratego-xtc \
    -la stratego-lib \
    -la stratego-gpp \
    -la stratego-tool-doc \
    -la stratego-sglr \
    -la ${HOME}/.nix-profile/lib/libjava-front.la \
    `pkg-config --variable=strcxtcflags strategoxt`

SDFINCLUDES    = -Idef ${HOME}/.nix-profile/share/java-front-syntax/JavaMix.def \
                 -Idef ${HOME}/.nix-profile/share/java-front/JavaEBlockMix.def \
                 -Idef ${HOME}/.nix-profile/share/java-front/EmbeddedJavaMix.def

# I don't care much for nullary constructor warnings unless it's about lowercase ones, such as 'start'
STRCSTFU=2>&1 | grep -vE 'warning ] Nullary constructor .*[A-Z]|warning ] multiple external| \[ExtSDef\(|stratego-trm|module-name-checked|module-name-checked"' \
                 >&2

STRINCLUDES = \
	-I $(HOME)/.nix-profile/share/sdf/xml-front \
	-I $(HOME)/.nix-profile/share/sdf/gpp \
	-I src/syntax \
    `pkg-config --variable=strcflags java-front`

all : sdf2imp src/include/sdf2imp.ctree syntax

check : all \
        tests/EditorService.runtestsuite \
        # tests/test-editor-descriptor.runsh \
        # tests/test-stratego-java.runsh

sdf2imp : $(RTREES) $(SYNTAX) Makefile src/include/rtg.tbl
	strc -i src/sdf2imp.str -o $@ $(STRINCLUDES) $(STRCFLAGS) -m main-sdf2imp $(STRCSTFU)
	rm sdf2imp.c sdf2imp.lo sdf2imp.o

syntax : $(SYNTAX)

clean :
	rm -f src/include/sdf2imp.ctree sdf2imp $(RTREES) $(wildcard src/syntax/*.tbl) $(wildcard src/syntax/*.def) *.dep include/*.dep
	
# files:

% : %.str $(STRS)

%.rtree : %.str $(SYNTAX)
	@parse-stratego -i $< -o $@ $(STRINCLUDES)

src/include/sdf2imp.ctree : sdf2imp
	strc -F --library -i src/sdf2imp.str -o $@ $(STRINCLUDES) $(STRCSTFU)

%.pp : %.def
	ppgen -i $< -o $@

%.pp.af : %.pp
	parse-pp-table -i $< -o $@

%.str : %.rtg
	rtg2sig -i $< -o $@

%.rtg : %.def
	sdf2rtg -i $< -o $@ -m `basename $*` --ignore-missing-cons

%.runtestsuite : %.testsuite
	parse-unit --no-heuristic-filters -i $< -p src/syntax/EditorService.tbl

%.runsh : %.sh
	sh $<

src/syntax/EditorService.def : src/syntax/EditorService.sdf $(SDFS)
	pack-sdf -i $< -o $@ -I src/syntax

src/syntax/EditorService.tbl : src/syntax/EditorService.def
	sdf2table -m EditorService -i $< -o $@

src/syntax/Stratego-Java-EditorService.def : src/syntax/Stratego-Java-EditorService.sdf $(SDFS)
	pack-sdf -i $< -o $@ -I src/syntax $(SDFINCLUDES)

src/syntax/Stratego-Java-EditorService.tbl : src/syntax/Stratego-Java-EditorService.def
	sdf2table -m Stratego-Java-EditorService -i $< -o $@

# We need a better solution for this
src/include/rtg.tbl : ~/.nix-profile/share/sdf/stratego-regular/rtg.tbl
	[ -e src/include ] || mkdir src/include
	baf2trm  -i $< -o $@ # cp $< $@

{'fraction_non_alphanumeric': 0.17096336499321574, 'fraction_numerical': 0.008141112618724558, 'mean_word_length': 2.7843696520251, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2875031', 'n_tokens_mistral': 2764, 'n_tokens_neox': 2577, 'n_words': 468}