+++ /dev/null
-;;; -*-lisp-*-
-;;;
-;;; System definition for the Sensible Object Design translator
-;;;
-;;; (c) 2009 Straylight/Edgeware
-;;;
-
-;;;----- Licensing notice ---------------------------------------------------
-;;;
-;;; This file is part of the Sensble Object Design, an object system for C.
-;;;
-;;; SOD is free software; you can redistribute it and/or modify
-;;; it under the terms of the GNU General Public License as published by
-;;; the Free Software Foundation; either version 2 of the License, or
-;;; (at your option) any later version.
-;;;
-;;; SOD is distributed in the hope that it will be useful,
-;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with SOD; if not, write to the Free Software Foundation,
-;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-(cl:defpackage #:sod-sysdef
- (:use #:common-lisp #:asdf))
-
-(cl:in-package #:sod-sysdef)
-
-;;;--------------------------------------------------------------------------
-;;; Definition.
-
-(defsystem sod
-
- ;; Boring copyright stuff.
- :version "0.2.0"
- :author "Mark Wooding"
- :license "GNU General Public License, version 2 or later"
-
- ;; Documentation.
- :description "A Sensible Object Design for C."
-
- :long-description
- "This system implements a fairly simple, yet powerful, object system for
- plain old C. Its main features are as follows.
-
- * Multiple inheritance, done properly (unlike C++, say), with a
- superclass linearlization algorithm, and exactly one copy of any
- superclass's slots.
-
- * Method combinations, and multiple flavours of methods, to make mixin
- classes more useful.
-
- * The default method combination doesn't depend on the programmer
- statically predicting which superclass's method to delegate to.
- Multiple inheritance makes this approach (taken by C++) fail: the
- right next method might be an unknown sibling, and two siblings might
- be in either order depending on descendents.
-
- * Minimal runtime support requirements, so that it's suitable for use
- wherever C is -- e.g., interfacing to other languages."
-
- :components
- ((:file "utilities")
-
- ;; Parser equipment. This is way more elaborate than it needs to be, but
- ;; it was interesting, and it may well get split off into a separate
- ;; library.
- (:module "parser" :depends-on ("utilities") :components
- ((:file "package")
-
- ;; File location protocol (including error reporting).
- (:file "floc-proto" :depends-on ("package"))
- (:file "floc-impl" :depends-on ("floc-proto"))
-
- ;; Position-aware streams.
- (:file "streams-proto" :depends-on ("package"))
- (:file "streams-impl" :depends-on ("streams-proto" "floc-proto"))
-
- ;; Scanner protocol, and various scanner implementations.
- (:file "scanner-proto" :depends-on ("package"))
- (:file "scanner-impl" :depends-on ("scanner-proto"))
- (:file "scanner-charbuf-impl" :depends-on
- ("scanner-proto" "floc-proto" "streams-proto"))
- (:file "scanner-token-impl" :depends-on ("scanner-proto"))
-
- ;; Parser notation macro support.
- (:file "parser-proto" :depends-on ("package"))
- (:file "parser-impl" :depends-on ("parser-proto"))
-
- ;; Expression parser support.
- (:file "parser-expr-proto" :depends-on ("parser-proto"))
- (:file "parser-expr-impl" :depends-on ("parser-expr-proto"))
-
- ;; Stitching parsers to scanners.
- (:file "scanner-context-impl" :depends-on
- ("parser-proto" "scanner-proto"))))
-
- (:file "package" :depends-on ("utilities" "parser"))
-
- ;; Lexical analysis.
- (:file "lexer-proto" :depends-on ("package" "parser"))
- (:file "lexer-impl" :depends-on ("lexer-proto"))
- (:file "fragment-parse" :depends-on ("lexer-proto"))
-
- ;; C type representation protocol.
- (:file "c-types-proto" :depends-on ("package"))
- (:file "c-types-impl" :depends-on ("c-types-proto"))
- (:file "c-types-parse" :depends-on
- ("c-types-proto" "c-types-class-impl" "fragment-parse"))
-
- ;; Property set protocol.
- (:file "pset-proto" :depends-on ("package"))
- (:file "pset-impl" :depends-on ("pset-proto"))
- (:file "pset-parse" :depends-on ("pset-proto" "lexer-proto"))
-
- ;; Code generation protocol.
- (:file "codegen-proto" :depends-on ("module-proto"))
- (:file "codegen-impl" :depends-on ("codegen-proto"))
-
- ;; Modules.
- (:file "module-proto" :depends-on ("package"))
- (:file "module-impl" :depends-on
- ("module-proto" "pset-proto" "c-types-class-impl" "builtin"))
- (:file "builtin" :depends-on
- ("module-proto" "pset-proto" "c-types-impl" "c-types-class-impl"
- "classes" "class-layout-proto"))
- (:file "module-parse" :depends-on
- ("class-make-proto" "class-finalize-proto"
- "fragment-parse" "lexer-proto" "module-impl"))
- (:file "module-output" :depends-on ("module-impl" "output-proto"))
-
- ;; Output.
- (:file "output-proto" :depends-on ("package"))
- (:file "output-impl" :depends-on ("output-proto"))
-
- ;; Class representation.
- (:file "classes" :depends-on ("package" "c-types-proto"))
- (:file "c-types-class-impl" :depends-on ("classes" "module-proto"))
- (:file "class-utilities" :depends-on
- ("classes" "codegen-impl" "pset-impl"
- "c-types-impl" "c-types-class-impl"))
-
- ;; Class construction.
- (:file "class-make-proto" :depends-on ("class-utilities"))
- (:file "class-make-impl" :depends-on ("class-make-proto"))
-
- ;; Class layout.
- (:file "class-layout-proto" :depends-on ("class-utilities"))
- (:file "class-layout-impl" :depends-on
- ("class-layout-proto" "method-proto"))
-
- ;; Class finalization.
- (:file "class-finalize-proto" :depends-on ("class-utilities"))
- (:file "class-finalize-impl" :depends-on ("class-finalize-proto"))
-
- ;; Method generation.
- (:file "method-proto" :depends-on ("class-make-proto"))
- (:file "method-impl" :depends-on ("method-proto"))
- (:file "method-aggregate" :depends-on ("method-impl"))
-
- ;; Class output.
- (:file "class-output" :depends-on
- ("classes" "class-layout-impl" "method-impl" "output-proto"))
-
- ;; Finishing touches of various kinds.
- (:file "final" :depends-on ("builtin" "module-output"))))
-
-;;;--------------------------------------------------------------------------
-;;; Testing.
-
-(defmethod perform ((op test-op) (component (eql (find-system "sod"))))
- (declare (ignore op component))
- (handler-bind (((or warning style-warning)
- (lambda (cond)
- (declare (ignore cond))
- (invoke-restart 'muffle-warning))))
- (operate 'test-op "sod-test")))
-
-;;;----- That's all, folks --------------------------------------------------