File: theme-d-compiler.scm

package info (click to toggle)
theme-d 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 12,784 kB
  • sloc: lisp: 47,684; sh: 4,200; makefile: 455; ansic: 319
file content (295 lines) | stat: -rw-r--r-- 5,823 bytes parent folder | download
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
;; Copyright (C) 2008-2013 Tommi Höynälänmaa
;; Distributed under GNU General Public License version 3,
;; see file doc/GPL-3.


(library (theme-d translator theme-d-compiler)

  (export gl-show-info?
	  gl-show-indented-debug-info?
	  debug-level
	  parse-search-path
	  dw1
	  dwl1
	  dvar1 dvar2 dvar3 dvar4 dvar7
	  is-target-object?
	  get-entity-type
	  is-t-class?
	  tno-field-ref
	  theme-compile-unit
	  gl-compiler
	  target-object-as-string
	  <target-object>)
  
  (import (guile)
	  (rnrs exceptions)
	  (only (rnrs) for-all exists)
	  (srfi srfi-1)
	  (srfi srfi-13)
	  (srfi srfi-43)
	  (th-scheme-utilities stdutils)
	  (th-scheme-utilities hrecord)
	  (theme-d common theme-d-config))


  ;; (add-to-load-path gl-theme-translator-dir)


  ;; forward declaration of a procedure
  (define translate-expr-fwd #f)


  (init-theme-d-config)
  
  (define gl-theme-d-translator-dir
    (get-theme-d-config-var 'translator-dir))

  
  (define (load-theme-file filename)
    (load-compiled (string-append gl-theme-d-translator-dir "/" filename ".go")))
  ;;  (load (string-append gl-theme-d-translator-dir "/" filename ".scm")))


  ;; *** Handling variable names ***

  (load-theme-file "theme-d-var-names")


  ;; *** Debug output ***

  (load-theme-file "theme-d-print-target-object")


  ;; *** Debugging ***

  (load-theme-file "theme-d-debug")


  ;; *** Common ***

  ;; (dwl4 "Common definitions")
  (load-theme-file "theme-d-common")


  ;; *** Support for hash tables ***

  ;; (dwl4 "Hash tables")
  (load-theme-file "theme-d-hash-tables")


  ;; *** Symbol table ***

					;(use-modules (general hrecord))
  ;; (dwl4 "Symbol table")
  (load-theme-file "theme-d-symbol-table")


  ;; *** Core definitions for compiling ***

  ;; (dwl4 "Compiler core def.")
  (load-theme-file "theme-d-compiler-core-def")


  ;; *** Entities ***

  ;; (dwl4 "Entities")
  (load-theme-file "theme-d-entities")


  ;; *** Expressions ***

  ;; (dwl4 "Expressions")
  (load-theme-file "theme-d-expressions")


  ;; *** Keywords ***

  ;; (dwl4 "Keywords")
  (load-theme-file "theme-d-keywords")


  ;; *** File handling ***

  ;; (dwl4 "File handling")
  (load-theme-file "theme-d-file-handling")


  ;; *** Macro system ***

  ;; (dwl4 "Macro system")
  (load-theme-file "theme-d-macro-config")
  (load-theme-file "theme-d-macros")


  ;; *** Common definitions for errors ***

  ;; (dwl4 "Common definitions for errors")
  (load-theme-file "theme-d-errors-common")


  ;; *** Compiler error output ***

  ;; (dwl4 "Compiler error output")
  (load-theme-file "theme-d-compilation-errors")


  ;; *** Representation of target objects ***

  ;; (dwl4 "Representation")
  (load-theme-file "theme-d-representation")


  ;; *** Parametrized instance cache ***

  ;; (dwl4 "Parametrized instance cache")
  (load-theme-file "theme-d-param-cache")


  ;; *** Binder ***

  ;; (dwl4 "Binder")
  (load-theme-file "theme-d-binder")


  ;; *** Address environment ***

  ;; (dwl4 "Address environment")
  (load-theme-file "theme-d-address-environment")


  ;; *** Type system ***

  ;; (dwl4 "Type system")
  (load-theme-file "theme-d-type-system")


  ;; *** Common utilities for procedures ***

  ;; (dwl4 "Common procedure utilities")
  (load-theme-file "theme-d-common-procedure-utilities")


  ;; *** Utilities for procedures ***

  ;; (dwl4 "Procedure utilities")
  (load-theme-file "theme-d-procedure-utilities")


  ;; *** Translation of type expressions ***

  ;; (dwl4 "Translation of type expressions")
  (load-theme-file "theme-d-type-translation")


  ;; *** Finalization of builtin types ***

  ;; (dwl4 "Finalization of builtin types")
  (load-theme-file "theme-d-builtin-type-finalization")


;;; *** Translation common ***

  ;; (dwl4 "Translation common")
  (load-theme-file "theme-d-translation-common")


  ;; *** Constructors ***

  ;; (dwl4 "Constructors")
  (load-theme-file "theme-d-constructors")


  ;; *** Parametrized definitions ***

  ;; (dwl4 "Parametrized definitions")
  (load-theme-file "theme-d-parametrized-definitions")


  ;; *** Parametrized instances ***

  ;; (dwl4 "Parametrized instances")
  (load-theme-file "theme-d-parametrized-instances")


  ;; *** Translation of expressions ***

  ;; (dwl4 "Translation of expressions")
  (load-theme-file "theme-d-expression-translation")


  ;; *** Compilation of letrec expressions ***

  ;; (dwl4 "Compilation of letrec expressions")
  (load-theme-file "theme-d-letrec-compilation")


  ;; *** Fields ***

  ;; (dwl4 "Fields")
  (load-theme-file "theme-d-fields")


  ;; *** Expression cloning ***

  ;; (dwl4 "Expression cloning")
  (load-theme-file "theme-d-expression-cloning")


  ;; *** Special procedures ***

  ;; (dwl4 "Special procedures")
  (load-theme-file "theme-d-special-procedures")


  ;; *** Pseudocode common ***

  ;; (dwl4 "Pseudocode common")
  (load-theme-file "theme-d-pcode-common")


  ;; *** Reading interface pseudocode ***

  ;; (dwl4 "Interface pseudocode reading")
  (load-theme-file "theme-d-interface-pcode-reading")


  ;; *** Translation utility functions***

  ;; (dwl4 "Compilation utility functions")
  (load-theme-file "theme-d-compilation-utilities")


  ;; *** Compilation 1 ***

  ;; (dwl4 "Compilation 1")
  (load-theme-file "theme-d-compilation1")


  ;; *** Compilation 2 ***

  ;; (dwl4 "Compilation 2")
  (load-theme-file "theme-d-compilation2")


  ;; *** Handling cyclic data structures ***

  ;; (dwl4 "Cycles")
  (load-theme-file "theme-d-cycles")


  ;; *** Phase 2 compilation ***

  ;; (dwl4 "Phase 2 comp")
  (load-theme-file "theme-d-phase2-compilation")


  ;; *** Unit compilation main function ***

  ;; (dwl4 "Unit compilation main function")
  (load-theme-file "theme-d-compile-unit")


  ;; *** Builtin definitions ***

  ;; (dwl4 "Builtins")
  (load-theme-file "theme-d-builtins"))