Commit | Line | Data |
---|---|---|
b0b180d5 AW |
1 | ;;; Guile Lowlevel Intermediate Language |
2 | ||
3 | ;; Copyright (C) 2001 Free Software Foundation, Inc. | |
4 | ||
5 | ;; This program is free software; you can redistribute it and/or modify | |
6 | ;; it under the terms of the GNU General Public License as published by | |
7 | ;; the Free Software Foundation; either version 2, or (at your option) | |
8 | ;; any later version. | |
9 | ;; | |
10 | ;; This program is distributed in the hope that it will be useful, | |
11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | ;; GNU General Public License for more details. | |
14 | ;; | |
15 | ;; You should have received a copy of the GNU General Public License | |
16 | ;; along with this program; see the file COPYING. If not, write to | |
17 | ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
18 | ;; Boston, MA 02111-1307, USA. | |
19 | ||
20 | ;;; Code: | |
21 | ||
22 | (define-module (language glil spec) | |
23 | #:use-module (system base language) | |
24 | #:use-module (language objcode spec) | |
9ff56d9e | 25 | #:use-module (language glil) |
d9042285 | 26 | #:use-module (language glil compile-objcode) |
b0b180d5 AW |
27 | #:export (glil)) |
28 | ||
29 | (define (write-glil exp . port) | |
30 | (apply write (unparse-glil exp) port)) | |
31 | ||
32 | (define (translate x) | |
33 | ;; Don't wrap in a thunk -- if you're down in these weeds you can | |
34 | ;; thunk it yourself. We don't know how many locs there will be, | |
35 | ;; anyway. | |
36 | (parse-glil x)) | |
37 | ||
38 | (define (compile x e opts) | |
d9042285 | 39 | (values (compile-objcode x e) e)) |
b0b180d5 AW |
40 | |
41 | (define-language glil | |
42 | #:title "Guile Lowlevel Intermediate Language (GLIL)" | |
43 | #:version "0.3" | |
44 | #:reader read | |
45 | #:printer write-glil | |
46 | #:parser translate | |
47 | #:compilers `((,objcode . ,compile)) | |
48 | ) |