diff options
Diffstat (limited to 'rego-proofs/compiler/main.scm')
| -rw-r--r-- | rego-proofs/compiler/main.scm | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/rego-proofs/compiler/main.scm b/rego-proofs/compiler/main.scm deleted file mode 100644 index 87d057a..0000000 --- a/rego-proofs/compiler/main.scm +++ /dev/null @@ -1,65 +0,0 @@ -;;; Copyright © 2023 Jakob L. Kreuze <zerodaysfordays@sdf.org> -;;; -;;; This program is free software; you can redistribute it and/or -;;; modify it under the terms of the GNU General Public License as -;;; published by the Free Software Foundation; either version 3 of the -;;; License, or (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with this program. If not, see -;;; <http://www.gnu.org/licenses/>. - -(define-module (compiler main) - #:use-module (compiler passes bool-to-prop) - #:use-module (compiler passes compile-constraints) - #:use-module (compiler passes compile-definition) - #:use-module (compiler passes compile-exists-some) - #:use-module (compiler passes compile-for-all) - #:use-module (compiler passes compile-funcall) - #:use-module (compiler passes compile-local-references) - #:use-module (compiler passes compile-object-literal) - #:use-module (compiler passes compile-reference) - #:use-module (compiler passes emit-specification) - #:use-module (compiler passes extract-identifiers) - #:use-module (compiler passes lift-comprehensions) - #:use-module (compiler passes lift-implicit-anonymous) - #:use-module (compiler passes parse-policy) - #:use-module (compiler passes read-and-parse) - #:use-module (compiler utilities) - #:use-module (ice-9 pretty-print) - #:use-module (srfi srfi-1) - #:export (main)) - -(define (main args) - "Entry point to the transpiler - -In normal interactive usage, it is expected that `args' is the result -of `(program-arguments)'." - (unless (= 2 (length args)) - (format (current-error-port) "usage: ~a [REGO-POLICY]~%" (first args)) - (quit 1)) - (let ((policy-file-name (second args))) - (unless (file-exists? policy-file-name) - (format (current-error-port) "file does not exist: ~a~%" policy-file-name) - (quit 1)) - (let* ((ast (read-and-parse policy-file-name)) - (policy (parse-policy ast)) - (policy (add-rules-to-scope policy)) - (policy (compile-definition policy)) - (policy (compile-comprehensions policy)) - (policy (compile-exists-some policy)) - (policy (lift-implicit-anonymous policy)) - (policy (compile-for-all policy)) - (policy (compile-object-literal policy)) - (policy (compile-constraints policy)) - (policy (compile-funcall policy)) - (policy (compile-reference policy)) - (policy (compile-bool-to-prop policy)) - (policy (compile-local-references policy))) - (pretty-print (to-pretty-sexp policy)) - (emit-specification policy)))) |