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