chiark / gitweb /
64f331bb739c36dac65432cfa8584be9d489e60f
[sod] / src / sod.asd
1 ;;; -*-lisp-*-
2 ;;;
3 ;;; System definition for the Simple 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
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
69    ;; library.
70    (:module "parser" :depends-on ("utilities") :components
71     ((:file "package")
72
73      ;; File location protocol (including error reporting).
74      (:file "proto-floc" :depends-on ("package"))
75      (:file "impl-floc" :depends-on ("proto-floc"))
76
77      ;; Position-aware streams.
78      (:file "proto-streams" :depends-on ("package"))
79      (:file "impl-streams" :depends-on ("proto-streams" "proto-floc"))
80
81      ;; Scanner protocol, and various scanner implementations.
82      (:file "proto-scanner" :depends-on ("package"))
83      (:file "impl-scanner" :depends-on ("proto-scanner"))
84      (:file "impl-scanner-charbuf" :depends-on
85             ("proto-scanner" "proto-floc" "proto-streams"))
86      (:file "impl-scanner-token" :depends-on ("proto-scanner"))
87
88      ;; Parser notation macro support.
89      (:file "proto-parser" :depends-on ("package"))
90      (:file "impl-parser" :depends-on ("proto-parser"))
91
92      ;; Expression parser support.
93      (:file "proto-parser-expr" :depends-on ("proto-parser"))
94      (:file "impl-parser-expr" :depends-on ("proto-parser-expr"))
95
96      ;; Stitching parsers to scanners.
97      (:file "impl-scanner-context" :depends-on
98             ("proto-parser" "proto-scanner"))))
99
100    (:file "package" :depends-on ("parser"))
101
102    ;; C type representation protocol.
103    (:file "proto-c-types" :depends-on ("package"))
104    (:file "impl-c-types" :depends-on ("proto-c-types"))
105
106    ;; Property set protocol.
107    (:file "proto-pset" :depends-on ("package"))
108    (:file "impl-pset" :depends-on ("proto-pset"))
109
110    ;; Lexical analysis.
111    ;;(:file "proto-lexer" :depends-on ("parser"))
112    ;;(:file "impl-lexer" :depends-on ("proto-lexer"))
113
114    ;; Code generation protocol.
115    (:file "proto-codegen" :depends-on ("package"))
116    (:file "impl-codegen" :depends-on ("proto-codegen"))
117
118    ;; Modules.
119    (:file "proto-module" :depends-on ("package"))
120    (:file "impl-module" :depends-on
121           ("proto-module" "proto-pset" "impl-c-types-class" "builtin"))
122    (:file "builtin" :depends-on ("proto-module" "proto-pset" "classes"
123                                  "impl-c-types" "impl-c-types-class"))
124
125    ;; Output.
126    (:file "proto-output" :depends-on ("package"))
127    (:file "impl-output" :depends-on ("proto-output"))
128
129    ;; Class representation.
130    (:file "classes" :depends-on ("package" "proto-c-types"))
131    (:file "impl-c-types-class" :depends-on ("classes" "proto-module"))
132    (:file "class-utilities" :depends-on
133           ("classes" "impl-codegen" "impl-pset"
134            "impl-c-types" "impl-c-types-class"))
135
136    ;; Class construction.
137    (:file "proto-class-make" :depends-on ("class-utilities"))
138    (:file "impl-class-make" :depends-on ("proto-class-make"))
139
140    ;; Class layout.
141    (:file "proto-class-layout" :depends-on ("class-utilities"))
142    (:file "impl-class-layout" :depends-on
143           ("proto-class-layout" "proto-method"))
144
145    ;; Class finalization.
146    (:file "proto-class-finalize" :depends-on ("class-utilities"))
147    (:file "impl-class-finalize" :depends-on ("proto-class-finalize"))
148
149    ;; Method generation.
150    (:file "proto-method" :depends-on ("class-utilities"))
151    (:file "impl-method" :depends-on ("proto-method"))
152
153    ;; Class output.
154    (:file "output-class" :depends-on ("proto-output" "classes"))))
155
156 ;;;--------------------------------------------------------------------------
157 ;;; Testing.
158
159 (defmethod perform ((op test-op) (component (eql (find-system "sod"))))
160   (operate 'test-op "sod-test" :force t))
161
162 ;;;----- That's all, folks --------------------------------------------------