Commit | Line | Data |
---|---|---|
dea4d055 MW |
1 | ;;; -*-lisp-*- |
2 | ;;; | |
d75ba5e3 | 3 | ;;; System definition for the Sensible Object Design translator |
dea4d055 MW |
4 | ;;; |
5 | ;;; (c) 2009 Straylight/Edgeware | |
6 | ;;; | |
7 | ||
8 | ;;;----- Licensing notice --------------------------------------------------- | |
9 | ;;; | |
e0808c47 | 10 | ;;; This file is part of the Sensible Object Design, an object system for C. |
dea4d055 MW |
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 | |
58a95090 MW |
27 | (:use #:common-lisp #:asdf) |
28 | (:export #:*version*)) | |
dea4d055 MW |
29 | |
30 | (cl:in-package #:sod-sysdef) | |
31 | ||
c43f7bbf MW |
32 | #|@-auto-@|# (load (merge-pathnames "auto.lisp" *load-pathname*)) |
33 | ||
34 | #+cmu (require :gray-streams) | |
58a95090 | 35 | |
dea4d055 MW |
36 | ;;;-------------------------------------------------------------------------- |
37 | ;;; Definition. | |
38 | ||
39 | (defsystem sod | |
40 | ||
41 | ;; Boring copyright stuff. | |
58a95090 | 42 | :version #.*sysdef-version* |
dea4d055 MW |
43 | :author "Mark Wooding" |
44 | :license "GNU General Public License, version 2 or later" | |
58a95090 | 45 | #|@-path-@|# :pathname "@srcdir@" |
dea4d055 MW |
46 | |
47 | ;; Documentation. | |
48 | :description "A Sensible Object Design for C." | |
49 | ||
50 | :long-description | |
d75ba5e3 | 51 | "This system implements a fairly simple, yet powerful, object system for |
dea4d055 MW |
52 | plain old C. Its main features are as follows. |
53 | ||
54 | * Multiple inheritance, done properly (unlike C++, say), with a | |
55 | superclass linearlization algorithm, and exactly one copy of any | |
56 | superclass's slots. | |
57 | ||
58 | * Method combinations, and multiple flavours of methods, to make mixin | |
59 | classes more useful. | |
60 | ||
61 | * The default method combination doesn't depend on the programmer | |
62 | statically predicting which superclass's method to delegate to. | |
63 | Multiple inheritance makes this approach (taken by C++) fail: the | |
64 | right next method might be an unknown sibling, and two siblings might | |
65 | be in either order depending on descendents. | |
66 | ||
67 | * Minimal runtime support requirements, so that it's suitable for use | |
68 | wherever C is -- e.g., interfacing to other languages." | |
69 | ||
70 | :components | |
71 | ((:file "utilities") | |
4d757a73 | 72 | (:file "optparse") |
dea4d055 MW |
73 | |
74 | ;; Parser equipment. This is way more elaborate than it needs to be, but | |
75 | ;; it was interesting, and it may well get split off into a separate | |
76 | ;; library. | |
77 | (:module "parser" :depends-on ("utilities") :components | |
78 | ((:file "package") | |
79 | ||
80 | ;; File location protocol (including error reporting). | |
aa14a4cd MW |
81 | (:file "floc-proto" :depends-on ("package")) |
82 | (:file "floc-impl" :depends-on ("floc-proto")) | |
dea4d055 MW |
83 | |
84 | ;; Position-aware streams. | |
aa14a4cd MW |
85 | (:file "streams-proto" :depends-on ("package")) |
86 | (:file "streams-impl" :depends-on ("streams-proto" "floc-proto")) | |
dea4d055 MW |
87 | |
88 | ;; Scanner protocol, and various scanner implementations. | |
aa14a4cd MW |
89 | (:file "scanner-proto" :depends-on ("package")) |
90 | (:file "scanner-impl" :depends-on ("scanner-proto")) | |
91 | (:file "scanner-charbuf-impl" :depends-on | |
92 | ("scanner-proto" "floc-proto" "streams-proto")) | |
93 | (:file "scanner-token-impl" :depends-on ("scanner-proto")) | |
dea4d055 MW |
94 | |
95 | ;; Parser notation macro support. | |
aa14a4cd MW |
96 | (:file "parser-proto" :depends-on ("package")) |
97 | (:file "parser-impl" :depends-on ("parser-proto")) | |
dea4d055 MW |
98 | |
99 | ;; Expression parser support. | |
aa14a4cd MW |
100 | (:file "parser-expr-proto" :depends-on ("parser-proto")) |
101 | (:file "parser-expr-impl" :depends-on ("parser-expr-proto")) | |
dea4d055 MW |
102 | |
103 | ;; Stitching parsers to scanners. | |
aa14a4cd MW |
104 | (:file "scanner-context-impl" :depends-on |
105 | ("parser-proto" "scanner-proto")))) | |
dea4d055 | 106 | |
7bfe3a37 | 107 | (:file "package" :depends-on ("utilities" "parser")) |
dea4d055 | 108 | |
239fa5bd MW |
109 | ;; Lexical analysis. |
110 | (:file "lexer-proto" :depends-on ("package" "parser")) | |
111 | (:file "lexer-impl" :depends-on ("lexer-proto")) | |
112 | (:file "fragment-parse" :depends-on ("lexer-proto")) | |
113 | ||
dea4d055 | 114 | ;; C type representation protocol. |
aa14a4cd | 115 | (:file "c-types-proto" :depends-on ("package")) |
074650bc | 116 | (:file "c-types-impl" :depends-on ("c-types-proto" "codegen-proto")) |
1d8cc67a MW |
117 | (:file "c-types-parse" :depends-on |
118 | ("c-types-proto" "c-types-class-impl" "fragment-parse")) | |
dea4d055 MW |
119 | |
120 | ;; Property set protocol. | |
6ee19709 | 121 | (:file "pset-proto" :depends-on ("package" "c-types-proto")) |
48eb81ca | 122 | (:file "pset-impl" :depends-on ("pset-proto" "module-proto")) |
239fa5bd | 123 | (:file "pset-parse" :depends-on ("pset-proto" "lexer-proto")) |
dea4d055 MW |
124 | |
125 | ;; Code generation protocol. | |
9ec578d9 | 126 | (:file "codegen-proto" :depends-on ("module-proto")) |
aa14a4cd | 127 | (:file "codegen-impl" :depends-on ("codegen-proto")) |
dea4d055 MW |
128 | |
129 | ;; Modules. | |
67260ebd | 130 | (:file "module-proto" :depends-on ("pset-proto" "package")) |
aa14a4cd MW |
131 | (:file "module-impl" :depends-on |
132 | ("module-proto" "pset-proto" "c-types-class-impl" "builtin")) | |
ea578bb4 MW |
133 | (:file "builtin" :depends-on |
134 | ("module-proto" "pset-proto" "c-types-impl" "c-types-class-impl" | |
a142609c | 135 | "classes" "class-layout-proto" "method-proto")) |
048d0b2d | 136 | (:file "module-parse" :depends-on |
ea578bb4 MW |
137 | ("class-make-proto" "class-finalize-proto" |
138 | "fragment-parse" "lexer-proto" "module-impl")) | |
048d0b2d | 139 | (:file "module-output" :depends-on ("module-impl" "output-proto")) |
dea4d055 MW |
140 | |
141 | ;; Output. | |
aa14a4cd MW |
142 | (:file "output-proto" :depends-on ("package")) |
143 | (:file "output-impl" :depends-on ("output-proto")) | |
dea4d055 MW |
144 | |
145 | ;; Class representation. | |
aa14a4cd MW |
146 | (:file "classes" :depends-on ("package" "c-types-proto")) |
147 | (:file "c-types-class-impl" :depends-on ("classes" "module-proto")) | |
dea4d055 | 148 | (:file "class-utilities" :depends-on |
aa14a4cd MW |
149 | ("classes" "codegen-impl" "pset-impl" |
150 | "c-types-impl" "c-types-class-impl")) | |
dea4d055 MW |
151 | |
152 | ;; Class construction. | |
aa14a4cd MW |
153 | (:file "class-make-proto" :depends-on ("class-utilities")) |
154 | (:file "class-make-impl" :depends-on ("class-make-proto")) | |
dea4d055 MW |
155 | |
156 | ;; Class layout. | |
aa14a4cd MW |
157 | (:file "class-layout-proto" :depends-on ("class-utilities")) |
158 | (:file "class-layout-impl" :depends-on | |
159 | ("class-layout-proto" "method-proto")) | |
dea4d055 MW |
160 | |
161 | ;; Class finalization. | |
aa14a4cd MW |
162 | (:file "class-finalize-proto" :depends-on ("class-utilities")) |
163 | (:file "class-finalize-impl" :depends-on ("class-finalize-proto")) | |
dea4d055 MW |
164 | |
165 | ;; Method generation. | |
bed8edd7 | 166 | (:file "method-proto" :depends-on ("class-make-proto")) |
aa14a4cd | 167 | (:file "method-impl" :depends-on ("method-proto")) |
e75eb63d | 168 | (:file "method-aggregate" :depends-on ("method-impl")) |
dea4d055 MW |
169 | |
170 | ;; Class output. | |
9ec578d9 | 171 | (:file "class-output" :depends-on |
9468000c | 172 | ("classes" "class-layout-impl" "method-impl" "output-proto")) |
dea4d055 | 173 | |
a9cffac1 | 174 | ;; Finishing touches of various kinds. |
4f8f9191 | 175 | (:file "final" :depends-on ("builtin" "module-output" "class-output")))) |
e33ea301 | 176 | |
dea4d055 MW |
177 | ;;;-------------------------------------------------------------------------- |
178 | ;;; Testing. | |
179 | ||
180 | (defmethod perform ((op test-op) (component (eql (find-system "sod")))) | |
1d8cc67a | 181 | (declare (ignore op component)) |
e43bd955 | 182 | (handler-bind (((or warning style-warning) #'muffle-warning)) |
8d1d7d3e | 183 | (operate 'test-op "sod-test"))) |
dea4d055 MW |
184 | |
185 | ;;;----- That's all, folks -------------------------------------------------- |