Preprocess a set of files.
(preprocess-files files &key (out-dir 'nil) (save ':auto) (preprocessor '"cpp") (extra-args ''("-P")) (state 'state)) → (mv erp map state)
This function preprocesses a filepath-setp. See preprocess-file for a similar utility which operates on individuals files.
Function:
(defun preprocess-files-fn (files out-dir save preprocessor extra-args state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (filepath-setp files) (or (not out-dir) (stringp out-dir)) (stringp preprocessor) (string-listp extra-args)))) (let ((__function__ 'preprocess-files)) (declare (ignorable __function__)) (b* (((reterr) (fileset nil) state) ((when (emptyp files)) (retok (fileset nil) state)) (out (and out-dir (b* ((filename (filepath->unwrap (head files)))) (and (stringp filename) (concatenate 'string out-dir "/" filename ".i"))))) ((erp - filedata state) (preprocess-file (head files) :out out :save save :preprocessor preprocessor :extra-args extra-args :state state)) ((erp (fileset fileset) state) (preprocess-files (rest files) :out-dir out-dir :save save :preprocessor preprocessor :extra-args extra-args :state state))) (retok (fileset (omap::update (head files) filedata fileset.unwrap)) state))))
Theorem:
(defthm filesetp-of-preprocess-files.map (b* (((mv acl2::?erp ?map acl2::?state) (preprocess-files-fn files out-dir save preprocessor extra-args state))) (filesetp map)) :rule-classes :rewrite)