@@@ progfmt wip
[sod] / src / sod.asd.in
1 ;;; -*-lisp-*-
2 ;;;
3 ;;; System definition for the Sensible Object Design translator
4 ;;;
5 ;;; (c) 2009 Straylight/Edgeware
6 ;;;
7
8 ;;;----- Licensing notice ---------------------------------------------------
9 ;;;
10 ;;; This file is part of the Sensible Object Design, an object system for C.
11 ;;;
12 ;;; SOD is free software; you can redistribute it and/or modify
13 ;;; it under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 2 of the License, or
15 ;;; (at your option) any later version.
16 ;;;
17 ;;; SOD is distributed in the hope that it will be useful,
18 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with SOD; if not, write to the Free Software Foundation,
24 ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26 (cl:defpackage #:sod-sysdef
27 (:use #:common-lisp #:asdf)
28 (:export #:*version*))
29
30 (cl:in-package #:sod-sysdef)
31
32 #|@-auto-@|# (load (make-pathname :name "AUTO" :type "LISP" :version :newest
33 :case :common :defaults *load-pathname*))
34
35 #+cmu (require :gray-streams)
36
37 ;;;--------------------------------------------------------------------------
38 ;;; Definition.
39
40 (defsystem sod
41
42 ;; Boring copyright stuff.
43 :version #.*sysdef-version*
44 :author "Mark Wooding"
45 :license "GNU General Public License, version 2 or later"
46 #|@-path-@|# :pathname "@srcdir@"
47
48 ;; Documentation.
49 :description "A Sensible Object Design for C."
50
51 :long-description
52 "This system implements a fairly simple, yet powerful, object system for
53 plain old C. Its main features are as follows.
54
55 * Multiple inheritance, done properly (unlike C++, say), with a
56 superclass linearlization algorithm, and exactly one copy of any
57 superclass's slots.
58
59 * Method combinations, and multiple flavours of methods, to make mixin
60 classes more useful.
61
62 * The default method combination doesn't depend on the programmer
63 statically predicting which superclass's method to delegate to.
64 Multiple inheritance makes this approach (taken by C++) fail: the
65 right next method might be an unknown sibling, and two siblings might
66 be in either order depending on descendents.
67
68 * Minimal runtime support requirements, so that it's suitable for use
69 wherever C is -- e.g., interfacing to other languages."
70
71 :components
72 ((:file "utilities")
73 (:file "optparse")
74
75 ;; Parser equipment. This is way more elaborate than it needs to be, but
76 ;; it was interesting, and it may well get split off into a separate
77 ;; library.
78 (:module "parser" :depends-on ("utilities") :components
79 ((:file "package")
80
81 ;; File location protocol (including error reporting).
82 (:file "floc-proto" :depends-on ("package"))
83 (:file "floc-impl" :depends-on ("floc-proto"))
84
85 ;; Position-aware streams.
86 (:file "streams-proto" :depends-on ("package"))
87 (:file "streams-impl" :depends-on ("streams-proto" "floc-proto"))
88
89 ;; Scanner protocol, and various scanner implementations.
90 (:file "scanner-proto" :depends-on ("package"))
91 (:file "scanner-impl" :depends-on ("scanner-proto"))
92 (:file "scanner-charbuf-impl" :depends-on
93 ("scanner-proto" "floc-proto" "streams-proto"))
94 (:file "scanner-token-impl" :depends-on ("scanner-proto"))
95
96 ;; Parser notation macro support.
97 (:file "parser-proto" :depends-on ("package"))
98 (:file "parser-impl" :depends-on ("parser-proto"))
99
100 ;; Expression parser support.
101 (:file "parser-expr-proto" :depends-on ("parser-proto"))
102 (:file "parser-expr-impl" :depends-on ("parser-expr-proto"))
103
104 ;; Stitching parsers to scanners.
105 (:file "scanner-context-impl" :depends-on
106 ("parser-proto" "scanner-proto"))))
107
108 (:file "package" :depends-on ("utilities" "parser"))
109
110 ;; Lexical analysis.
111 (:file "lexer-proto" :depends-on ("package" "parser"))
112 (:file "lexer-impl" :depends-on ("lexer-proto"))
113 (:file "fragment-parse" :depends-on ("lexer-proto"))
114
115 ;; C type representation protocol.
116 (:file "c-types-proto" :depends-on ("package"))
117 (:file "c-types-impl" :depends-on ("c-types-proto" "codegen-proto"))
118 (:file "c-types-parse" :depends-on
119 ("c-types-proto" "c-types-class-impl" "fragment-parse"))
120
121 ;; Property set protocol.
122 (:file "pset-proto" :depends-on ("package" "c-types-proto"))
123 (:file "pset-impl" :depends-on ("pset-proto" "module-proto"))
124 (:file "pset-parse" :depends-on ("pset-proto" "lexer-proto"))
125
126 ;; Code generation protocol.
127 (:file "codegen-proto" :depends-on ("module-proto"))
128 (:file "codegen-impl" :depends-on ("codegen-proto"))
129
130 ;; Modules.
131 (:file "module-proto" :depends-on ("pset-proto" "package"))
132 (:file "module-impl" :depends-on
133 ("module-proto" "pset-proto" "c-types-class-impl" "builtin"))
134 (:file "builtin" :depends-on
135 ("module-proto" "pset-proto" "c-types-impl" "c-types-class-impl"
136 "classes" "class-layout-proto" "method-proto"))
137 (:file "module-parse" :depends-on
138 ("class-make-proto" "class-finalize-proto"
139 "fragment-parse" "lexer-proto" "module-impl"))
140 (:file "module-output" :depends-on ("module-impl" "output-proto"))
141
142 ;; Output.
143 (:file "output-proto" :depends-on ("package"))
144 (:file "output-impl" :depends-on ("output-proto"))
145
146 ;; Class representation.
147 (:file "classes" :depends-on ("package" "c-types-proto"))
148 (:file "c-types-class-impl" :depends-on ("classes" "module-proto"))
149 (:file "class-utilities" :depends-on
150 ("classes" "codegen-impl" "pset-impl"
151 "c-types-impl" "c-types-class-impl"))
152
153 ;; Class construction.
154 (:file "class-make-proto" :depends-on ("class-utilities"))
155 (:file "class-make-impl" :depends-on ("class-make-proto"))
156
157 ;; Class layout.
158 (:file "class-layout-proto" :depends-on ("class-utilities"))
159 (:file "class-layout-impl" :depends-on
160 ("class-layout-proto" "method-proto"))
161
162 ;; Class finalization.
163 (:file "class-finalize-proto" :depends-on ("class-utilities"))
164 (:file "class-finalize-impl" :depends-on ("class-finalize-proto"))
165
166 ;; Method generation.
167 (:file "method-proto" :depends-on ("class-make-proto"))
168 (:file "method-impl" :depends-on ("method-proto"))
169 (:file "method-aggregate" :depends-on ("method-impl"))
170
171 ;; Class output.
172 (:file "class-output" :depends-on
173 ("classes" "class-layout-impl" "method-impl" "output-proto"))
174
175 ;; Finishing touches of various kinds.
176 (:file "final" :depends-on ("builtin" "module-output" "class-output"))))
177
178 ;;;--------------------------------------------------------------------------
179 ;;; Testing.
180
181 (defmethod perform ((op test-op) (component (eql (find-system "sod"))))
182 (declare (ignore op component))
183 (handler-bind (((or warning style-warning) #'muffle-warning))
184 (operate 'test-op "sod-test")))
185
186 ;;;----- That's all, folks --------------------------------------------------