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