-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfind-parseable.clj
31 lines (27 loc) · 1.17 KB
/
find-parseable.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
;; setup paths
(def ROOT-DIR "../")
(def META-INF-DIR (java.io.File. (str ROOT-DIR "/meta-information")))
;; get a sequence of all meta-information files in the directory
(def meta-files (remove (fn [file] (.isDirectory file)) (file-seq META-INF-DIR)))
(defn read-meta-file [f]
(read-string (slurp f)))
(spit
"parseable-eventb-machines.txt"
(clojure.string/join \newline
(->> meta-files
(map read-meta-file)
(filter (fn [data]
(and
(= (:formalism data) :eventb)
(not (empty? (:included-machines data))))))
(map :file))))
(spit
"parseable-b-machines.txt"
(clojure.string/join \newline
(->> meta-files
(map read-meta-file)
(filter (fn [data]
(and
(= (:formalism data) :b)
(not (empty? (:included-machines data))))))
(map :file))))