3 ;;; System definition for the Simple 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))
29 (cl:in-package #:sod-sysdef)
31 ;;;--------------------------------------------------------------------------
36 ;; Boring copyright stuff.
38 :author "Mark Wooding"
39 :license "GNU General Public License, version 2 or later"
42 :description "A Sensible Object Design for C."
45 "This system implements a fairly simple, yet powerful object system for
46 plain old C. Its main features are as follows.
48 * Multiple inheritance, done properly (unlike C++, say), with a
49 superclass linearlization algorithm, and exactly one copy of any
52 * Method combinations, and multiple flavours of methods, to make mixin
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.
61 * Minimal runtime support requirements, so that it's suitable for use
62 wherever C is -- e.g., interfacing to other languages."
67 ;; Parser equipment. This is way more elaborate than it needs to be, but
68 ;; it was interesting, and it may well get split off into a separate
70 (:module "parser" :depends-on ("utilities") :components
73 ;; File location protocol (including error reporting).
74 (:file "floc-proto" :depends-on ("package"))
75 (:file "floc-impl" :depends-on ("floc-proto"))
77 ;; Position-aware streams.
78 (:file "streams-proto" :depends-on ("package"))
79 (:file "streams-impl" :depends-on ("streams-proto" "floc-proto"))
81 ;; Scanner protocol, and various scanner implementations.
82 (:file "scanner-proto" :depends-on ("package"))
83 (:file "scanner-impl" :depends-on ("scanner-proto"))
84 (:file "scanner-charbuf-impl" :depends-on
85 ("scanner-proto" "floc-proto" "streams-proto"))
86 (:file "scanner-token-impl" :depends-on ("scanner-proto"))
88 ;; Parser notation macro support.
89 (:file "parser-proto" :depends-on ("package"))
90 (:file "parser-impl" :depends-on ("parser-proto"))
92 ;; Expression parser support.
93 (:file "parser-expr-proto" :depends-on ("parser-proto"))
94 (:file "parser-expr-impl" :depends-on ("parser-expr-proto"))
96 ;; Stitching parsers to scanners.
97 (:file "scanner-context-impl" :depends-on
98 ("parser-proto" "scanner-proto"))))
100 (:file "package" :depends-on ("parser"))
103 (:file "lexer-proto" :depends-on ("package" "parser"))
104 (:file "lexer-impl" :depends-on ("lexer-proto"))
105 (:file "fragment-parse" :depends-on ("lexer-proto"))
107 ;; C type representation protocol.
108 (:file "c-types-proto" :depends-on ("package"))
109 (:file "c-types-impl" :depends-on ("c-types-proto"))
110 (:file "c-types-parse" :depends-on ("c-types-proto" "fragment-parse"))
112 ;; Property set protocol.
113 (:file "pset-proto" :depends-on ("package"))
114 (:file "pset-impl" :depends-on ("pset-proto"))
115 (:file "pset-parse" :depends-on ("pset-proto" "lexer-proto"))
117 ;; Code generation protocol.
118 (:file "codegen-proto" :depends-on ("package"))
119 (:file "codegen-impl" :depends-on ("codegen-proto"))
122 (:file "module-proto" :depends-on ("package"))
123 (:file "module-impl" :depends-on
124 ("module-proto" "pset-proto" "c-types-class-impl" "builtin"))
125 (:file "builtin" :depends-on
126 ("module-proto" "pset-proto" "c-types-impl" "c-types-class-impl"
127 "classes" "class-layout-proto"))
128 (:file "module-parse" :depends-on
129 ("class-make-proto" "class-finalize-proto"
130 "fragment-parse" "lexer-proto" "module-impl"))
131 (:file "module-output" :depends-on ("module-impl" "output-proto"))
134 (:file "output-proto" :depends-on ("package"))
135 (:file "output-impl" :depends-on ("output-proto"))
137 ;; Class representation.
138 (:file "classes" :depends-on ("package" "c-types-proto"))
139 (:file "c-types-class-impl" :depends-on ("classes" "module-proto"))
140 (:file "class-utilities" :depends-on
141 ("classes" "codegen-impl" "pset-impl"
142 "c-types-impl" "c-types-class-impl"))
144 ;; Class construction.
145 (:file "class-make-proto" :depends-on ("class-utilities"))
146 (:file "class-make-impl" :depends-on ("class-make-proto"))
149 (:file "class-layout-proto" :depends-on ("class-utilities"))
150 (:file "class-layout-impl" :depends-on
151 ("class-layout-proto" "method-proto"))
153 ;; Class finalization.
154 (:file "class-finalize-proto" :depends-on ("class-utilities"))
155 (:file "class-finalize-impl" :depends-on ("class-finalize-proto"))
157 ;; Method generation.
158 (:file "method-proto" :depends-on ("class-utilities"))
159 (:file "method-impl" :depends-on ("method-proto"))
162 (:file "class-output" :depends-on ("output-proto" "classes"))))
164 ;;;--------------------------------------------------------------------------
167 (defmethod perform ((op test-op) (component (eql (find-system "sod"))))
168 (operate 'test-op "sod-test" :force t))
170 ;;;----- That's all, folks --------------------------------------------------