3 ;;; System definition for the Sensible Object Design translator
5 ;;; (c) 2009 Straylight/Edgeware
8 ;;;----- Licensing notice ---------------------------------------------------
10 ;;; This file is part of the Sensble Object Design, an object system for C.
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.
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.
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.
26 (cl:defpackage #:sod-sysdef
27 (:use #:common-lisp #:asdf)
28 (:export #:*version*))
30 (cl:in-package #:sod-sysdef)
32 #|@-auto-@|# (load "auto.lisp")
34 ;;;--------------------------------------------------------------------------
39 ;; Boring copyright stuff.
40 :version #.*sysdef-version*
41 :author "Mark Wooding"
42 :license "GNU General Public License, version 2 or later"
43 #|@-path-@|# :pathname "@srcdir@"
46 :description "A Sensible Object Design for C."
49 "This system implements a fairly simple, yet powerful, object system for
50 plain old C. Its main features are as follows.
52 * Multiple inheritance, done properly (unlike C++, say), with a
53 superclass linearlization algorithm, and exactly one copy of any
56 * Method combinations, and multiple flavours of methods, to make mixin
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.
65 * Minimal runtime support requirements, so that it's suitable for use
66 wherever C is -- e.g., interfacing to other languages."
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
74 (:module "parser" :depends-on ("utilities") :components
77 ;; File location protocol (including error reporting).
78 (:file "floc-proto" :depends-on ("package"))
79 (:file "floc-impl" :depends-on ("floc-proto"))
81 ;; Position-aware streams.
82 (:file "streams-proto" :depends-on ("package"))
83 (:file "streams-impl" :depends-on ("streams-proto" "floc-proto"))
85 ;; Scanner protocol, and various scanner implementations.
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"))
92 ;; Parser notation macro support.
93 (:file "parser-proto" :depends-on ("package"))
94 (:file "parser-impl" :depends-on ("parser-proto"))
96 ;; Expression parser support.
97 (:file "parser-expr-proto" :depends-on ("parser-proto"))
98 (:file "parser-expr-impl" :depends-on ("parser-expr-proto"))
100 ;; Stitching parsers to scanners.
101 (:file "scanner-context-impl" :depends-on
102 ("parser-proto" "scanner-proto"))))
104 (:file "package" :depends-on ("utilities" "parser"))
107 (:file "lexer-proto" :depends-on ("package" "parser"))
108 (:file "lexer-impl" :depends-on ("lexer-proto"))
109 (:file "fragment-parse" :depends-on ("lexer-proto"))
111 ;; C type representation protocol.
112 (:file "c-types-proto" :depends-on ("package"))
113 (:file "c-types-impl" :depends-on ("c-types-proto"))
114 (:file "c-types-parse" :depends-on
115 ("c-types-proto" "c-types-class-impl" "fragment-parse"))
117 ;; Property set protocol.
118 (:file "pset-proto" :depends-on ("package"))
119 (:file "pset-impl" :depends-on ("pset-proto"))
120 (:file "pset-parse" :depends-on ("pset-proto" "lexer-proto"))
122 ;; Code generation protocol.
123 (:file "codegen-proto" :depends-on ("module-proto"))
124 (:file "codegen-impl" :depends-on ("codegen-proto"))
127 (:file "module-proto" :depends-on ("package"))
128 (:file "module-impl" :depends-on
129 ("module-proto" "pset-proto" "c-types-class-impl" "builtin"))
130 (:file "builtin" :depends-on
131 ("module-proto" "pset-proto" "c-types-impl" "c-types-class-impl"
132 "classes" "class-layout-proto"))
133 (:file "module-parse" :depends-on
134 ("class-make-proto" "class-finalize-proto"
135 "fragment-parse" "lexer-proto" "module-impl"))
136 (:file "module-output" :depends-on ("module-impl" "output-proto"))
139 (:file "output-proto" :depends-on ("package"))
140 (:file "output-impl" :depends-on ("output-proto"))
142 ;; Class representation.
143 (:file "classes" :depends-on ("package" "c-types-proto"))
144 (:file "c-types-class-impl" :depends-on ("classes" "module-proto"))
145 (:file "class-utilities" :depends-on
146 ("classes" "codegen-impl" "pset-impl"
147 "c-types-impl" "c-types-class-impl"))
149 ;; Class construction.
150 (:file "class-make-proto" :depends-on ("class-utilities"))
151 (:file "class-make-impl" :depends-on ("class-make-proto"))
154 (:file "class-layout-proto" :depends-on ("class-utilities"))
155 (:file "class-layout-impl" :depends-on
156 ("class-layout-proto" "method-proto"))
158 ;; Class finalization.
159 (:file "class-finalize-proto" :depends-on ("class-utilities"))
160 (:file "class-finalize-impl" :depends-on ("class-finalize-proto"))
162 ;; Method generation.
163 (:file "method-proto" :depends-on ("class-make-proto"))
164 (:file "method-impl" :depends-on ("method-proto"))
165 (:file "method-aggregate" :depends-on ("method-impl"))
168 (:file "class-output" :depends-on
169 ("classes" "class-layout-impl" "method-impl" "output-proto"))
171 ;; Finishing touches of various kinds.
172 (:file "final" :depends-on ("builtin" "module-output"))))
174 ;;;--------------------------------------------------------------------------
177 (defmethod perform ((op test-op) (component (eql (find-system "sod"))))
178 (declare (ignore op component))
179 (handler-bind (((or warning style-warning)
181 (declare (ignore cond))
182 (invoke-restart 'muffle-warning))))
183 (operate 'test-op "sod-test")))
185 ;;;----- That's all, folks --------------------------------------------------