Today's wip.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 23 Jul 2013 23:49:14 +0000 (00:49 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 24 Jul 2013 01:00:26 +0000 (02:00 +0100)
12 files changed:
doc/sod.tex
doc/standard-method-combination.svg
src/builtin.lisp
src/c-types-parse.lisp
src/c-types-test.lisp
src/class-layout-impl.lisp
src/module-output.lisp
src/module-parse.lisp
src/output-impl.lisp
src/parser/streams-proto.lisp
src/pset-proto.lisp
src/sod.asd

index ba2aaa5..8a46735 100644 (file)
@@ -169,11 +169,11 @@ unusual notation in order to make the presentation easier to read.
   \end{quote}
 \item @[@<item>@] means an optional @<item>:
   \begin{quote}
-    \syntax{@[<item>@] ::= $\epsilon$ | <item>}
+    \syntax{@[<item>@] ::= $\epsilon$ @! <item>}
   \end{quote}
 \item @<item>^* means a sequence of zero or more @<item>s:
   \begin{quote}
-    \syntax{@<item>^* ::= $\epsilon$ | @<item>^* <item>}
+    \syntax{@<item>^* ::= $\epsilon$ @! @<item>^* <item>}
   \end{quote}
 \item @<item>^+ means a sequence of one or more @<item>s:
   \begin{quote}
@@ -182,7 +182,7 @@ unusual notation in order to make the presentation easier to read.
 \item @<item-list> means a sequence of one or more @<item>s separated
   by commas:
   \begin{quote}
-    \syntax{<item-list> ::= <item> | <item-list> "," <item>}
+    \syntax{<item-list> ::= <item> @! <item-list> "," <item>}
   \end{quote}
 \end{itemize}
 
@@ -611,31 +611,29 @@ All of these have their usual C meanings.
 \subsubsection{Declarators} \label{sec:syntax.c-types.declarator}
 
 \begin{grammar}
-<declarator> ::=
-  @<pointer>^* <inner-declarator> @<declarator-suffix>^*
+<declarator>$[k]$ ::= @<pointer>^* <primary-declarator>$[k]$
 
-<inner-declarator> ::= <identifier> | <qualified-identifier>
-\alt "(" <declarator> ")"
-
-<qualified-identifier> ::= <identifier> "." <identifier>
+<primary-declarator>$[k]$ ::= $k$
+\alt "(" <primary-declarator>$[k]$ ")"
+\alt <primary-declarator>$[k]$ @<declarator-suffix>^*
 
 <pointer> ::= "*" @<qualifier>^*
 
 <declarator-suffix> ::= "[" <c-fragment> "]"
 \alt "(" <arguments> ")"
 
-<arguments> ::= <empty> | "..."
+<arguments> ::= $\epsilon$ | "..."
 \alt <argument-list> @["," "..."@]
 
 <argument> ::= @<declaration-specifier>^+ <argument-declarator>
 
-<argument-declarator> ::= <declarator> | @[<abstract-declarator>@]
+<argument-declarator> ::= <declarator>@[<identifier> @! $\epsilon$@]
+
+<simple-declarator> ::= <declarator>@[<identifier>@]
 
-<abstract-declarator> ::=
-  @<pointer>^+ | @<pointer>^* <inner-abstract-declarator>
+<dotted-name> ::= <identifier> "." <identifier>
 
-<inner-abstract-declarator> ::= "(" <abstract-declarator> ")"
-\alt @[<inner-abstract-declarator>@] @<declarator-suffix>^+
+<dotted-declarator> ::= <declarator>@[<dotted-name>@]
 \end{grammar}
 
 The declarator syntax is taken from C, but with some differences.
index c54f546..f2ca2f3 100644 (file)
          id="text7219"
          y="743.74951"
          x="137.82718"
-         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Palladio Uralic;-inkscape-font-specification:Palladio Uralic"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L"
          xml:space="preserve"><tspan
            id="tspan7221"
            y="743.74951"
          style="fill:none;fill-rule:evenodd;stroke:#00c800;stroke-width:0.75000000000000000;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#Arrow1Mend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
       <flowRoot
          transform="translate(-301.49963,-67.218524)"
-         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#00c800;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Palladio Uralic;-inkscape-font-specification:Palladio Uralic"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#00c800;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L"
          id="flowRoot7234"
          xml:space="preserve"><flowRegion
            id="flowRegion7236"><rect
          id="path7292" />
       <text
          xml:space="preserve"
-         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Palladio Uralic;-inkscape-font-specification:Palladio Uralic"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L"
          x="149.36943"
          y="762.65088"
          id="text7294"><tspan
          x="0" />
       <text
          xml:space="preserve"
-         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Palladio Uralic;-inkscape-font-specification:Palladio Uralic"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L"
          x="334.1524"
          y="735.396"
          id="text7428"><tspan
       <flowRoot
          xml:space="preserve"
          id="flowRoot7434"
-         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#00c800;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Palladio Uralic;-inkscape-font-specification:Palladio Uralic"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#00c800;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L"
          transform="translate(54.25206,-67.572077)"><flowRegion
            id="flowRegion7436"><rect
              id="rect7438"
          id="text7444"
          y="715.43781"
          x="326.31656"
-         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Palladio Uralic;-inkscape-font-specification:Palladio Uralic"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L"
          xml:space="preserve"><tspan
            style="font-style:italic"
            y="715.43781"
          id="text7983"
          y="-289.09686"
          x="705.11279"
-         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#0000c8;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Palladio Uralic;-inkscape-font-specification:Palladio Uralic"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#0000c8;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L"
          xml:space="preserve"><tspan
            y="-289.09686"
            x="705.11279"
            id="path5000" />
         <text
            xml:space="preserve"
-           style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:end;line-height:125%;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Palladio Uralic;-inkscape-font-specification:Palladio Uralic"
+           style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:end;line-height:125%;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L"
            x="239.44922"
            y="856.36218"
            id="text2952"
            id="text5030"
            y="855.92719"
            x="299.5"
-           style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Palladio Uralic;-inkscape-font-specification:Palladio Uralic"
+           style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L"
            xml:space="preserve"><tspan
              style="font-style:italic"
              y="855.92719"
            id="text5072"
            y="808.65448"
            x="263"
-           style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Palladio Uralic;-inkscape-font-specification:Palladio Uralic"
+           style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L"
            xml:space="preserve"><tspan
              y="808.65448"
              x="263"
         <flowRoot
            xml:space="preserve"
            id="flowRoot5638"
-           style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#00c800;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Palladio Uralic;-inkscape-font-specification:Palladio Uralic"
+           style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#00c800;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L"
            transform="translate(-34.5,48.169125)"><flowRegion
              id="flowRegion5640"><rect
                id="rect5642"
            id="text3155"
            y="873.42499"
            x="236.11349"
-           style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Palladio Uralic;-inkscape-font-specification:Palladio Uralic"
+           style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L"
            xml:space="preserve"><tspan
              id="tspan3159"
              y="873.42499"
          x="0" />
       <flowRoot
          transform="translate(-24.870058,-7.68156)"
-         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Palladio Uralic;-inkscape-font-specification:Palladio Uralic"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L"
          id="flowRoot7999"
          xml:space="preserve"><flowRegion
            id="flowRegion8001"><rect
          transform="translate(35.941561,-179.31502)">
         <text
            xml:space="preserve"
-           style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Palladio Uralic;-inkscape-font-specification:Palladio Uralic"
+           style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L"
            x="236.11349"
            y="873.42499"
            id="text3030"
index 7ea022e..f219257 100644 (file)
@@ -31,7 +31,7 @@
 (defvar *class-slot-alist* nil)
 
 (defun add-class-slot-function (name function)
-  "Attach a slot function to the *class-slot-alist*.
+  "Attach a slot function to the `*class-slot-alist*'.
 
    The FUNCTION is invoked with one argument, which is a `sod-class' object
    to which it should add a slot.  If a function with the same NAME is
     (name (class &optional stream) type init &body prepare)
   "Define a new class slot.
 
-   The slot will be caled NAME, and will be of TYPE (which should be a type
-   S-expression).  The slot's (static) initializer will be constructed by
-   printing the value of INIT, which is evaluated with CLASS bound to the
-   class object being constructed.  If any PREPARE forms are provided, then
-   they are evaluated as a progn; they are evaluated with CLASS bound to the
+   The slot will be called NAME (a string) and will be of TYPE (which should
+   be a type S-expression).  The slot's (static) initializer will be
+   constructed by printing the value of INIT, which is evaluated with CLASS
+   bound to the class object being constructed.  If any PREPARE forms are
+   provided, then they are evaluated as a progn, with CLASS bound to the
    class object, and STREAM bound to the output stream it should write on."
 
   (with-gensyms (classvar)
@@ -95,7 +95,7 @@ static void *~A__imprint(void *p)
 {
   struct ~A *sod__obj = p;
 
-  ~:{sod__obj.~A.~A._vt = &~A;~:^~%  ~}
+  ~:{sod__obj->~A.~A._vt = &~A;~:^~%  ~}
   return (p);
 }~2%"
            class
@@ -113,15 +113,13 @@ static void *~A__imprint(void *p)
   (format nil "~A__init" class)
 
   ;; FIXME this needs a metaobject protocol
-  (let ((ilayout (sod-class-ilayout class)))
+  (let ((ilayout (sod-class-ilayout class))
+       (used nil))
     (format stream "~&~:
-static void *~A__init(void *p)
-{
-  struct ~A *sod__obj = ~0@*~A__imprint(p);~2%"
-           class
-           (ilayout-struct-tag class))
+/* Provide initial values for an instance's slots. */
+static void *~A__init(void *p)~%{~%" class)
     (dolist (ichain (ilayout-ichains ilayout))
-      (let ((ich (format nil "sod__obj.~A.~A"
+      (let ((ich (format nil "sod__obj->~A.~A"
                         (sod-class-nickname (ichain-head ichain))
                         (sod-class-nickname (ichain-tail ichain)))))
        (dolist (item (ichain-body ichain))
@@ -136,6 +134,13 @@ static void *~A__init(void *p)
                 (let ((dslot (effective-slot-direct-slot slot))
                       (init (effective-slot-initializer slot)))
                   (when init
+                    (unless used
+                      (format stream
+                              "  struct ~A *sod__obj = ~
+                                   ~0@*~A__imprint(p);~2%"
+                              class
+                              (ilayout-struct-tag class))
+                      (setf used t))
                     (format stream "  ~A.~A =" isl
                             (sod-slot-name dslot))
                     (ecase (sod-initializer-value-kind init)
@@ -149,6 +154,8 @@ static void *~A__init(void *p)
                                         :stream stream
                                         :pretty nil :escape nil)
                                  (format stream "};~%"))))))))))))
+    (unless used
+      (format stream "  ~A__imprint(p);~%" class))
     (format stream "~&~:
   return (p);
 }~2%")))
@@ -246,6 +253,11 @@ static const SodClass *const ~A__cpl[] = {
 ;;; Bootstrapping the class graph.
 
 (defun bootstrap-classes (module)
+  "Bootstrap the braid in MODULE.
+
+   This builds the fundamental recursive braid, where `SodObject' is an
+   instance of `SodClass', and `SodClass' is a subclass of `SodObject' (and
+   an instance of itself)."
   (let* ((sod-object (make-sod-class "SodObject" nil
                                     (make-property-set :nick 'obj)))
         (sod-class (make-sod-class "SodClass" (list sod-object)
@@ -277,30 +289,41 @@ static const SodClass *const ~A__cpl[] = {
       (finalize-sod-class class)
       (add-to-module module class))))
 
+(defvar *builtin-module* nil
+  "The builtin module.")
+
 (defun make-builtin-module ()
+  "Construct the builtin module.
+
+   This involves constructing the braid (which is done in `bootstrap-classes'
+   and defining a few obvious type names which users will find handy.
+
+   Returns the newly constructed module, and stores it in the variable
+   `*builtin-module*'."
   (let ((module (make-instance 'module
                               :name (make-pathname :name "SOD-BASE"
                                                    :type "SOD"
                                                    :case :common)
-                              :state nil))
-       (include (format nil "#include \"~A\"~%"
-                        (make-pathname :name "SOD" :type "H"
-                                       :case :common))))
+                              :state nil)))
     (call-with-module-environment
      (lambda ()
        (dolist (name '("va_list" "size_t" "ptrdiff_t"))
         (add-to-module module (make-instance 'type-item :name name)))
-       (add-to-module module (make-instance 'code-fragment-item
-                                           :reason :c
-                                           :constraints nil
-                                           :name :includes
-                                           :fragment include))
+       (flet ((header-name (name)
+               (concatenate 'string "\"" (string-downcase name) ".h\""))
+             (add-includes (reason &rest names)
+               (let ((text (with-output-to-string (out)
+                             (dolist (name names)
+                               (format out "#include ~A~%" name)))))
+                 (add-to-module module
+                                (make-instance 'code-fragment-item
+                                               :reason reason
+                                               :constraints nil
+                                               :name :includes
+                                               :fragment text)))))
+        (add-includes :c (header-name "sod"))
+        (add-includes :h "<stddef.h>"))
        (bootstrap-classes module)))
-    module))
-
-(defvar *builtin-module* nil)
-
-(define-clear-the-decks reset-builtin-module
-  (setf *builtin-module* (make-builtin-module)))
+    (setf *builtin-module* module)))
 
 ;;;----- That's all, folks --------------------------------------------------
index e3ac625..5f2e438 100644 (file)
 ;;; `parse-declarator' will be of this form.
 
 (export 'parse-declarator)
-(defun parse-declarator (scanner base-type &key centre abstractp)
+(defun parse-declarator (scanner base-type &key kernel abstractp)
   "Parse a C declarator, returning a pair (C-TYPE . NAME).
 
    The SCANNER is a token scanner to read from.  The BASE-TYPE is the type
 
    The result contains both the resulting constructed C-TYPE (with any
    qualifiers etc. as necessary), and the name from the middle of the
-   declarator.  The name is parsed using the CENTRE parser provided, and
+   declarator.  The name is parsed using the KERNEL parser provided, and
    defaults to matching a simple identifier `:id'.  This might, e.g., be
    (? :id) to parse an `abstract declarator' which has optional names.
 
-   There's an annoying ambiguity in the syntax, if an empty CENTRE is
+   There's an annoying ambiguity in the syntax, if an empty KERNEL is
    permitted.  In this case, you must ensure that ABSTRACTP is true so that
    the appropriate heuristic can be applied.  As a convenience, if ABSTRACTP
-   is true then `(? :id)' is used as the default CENTRE."
+   is true then `(? :id)' is used as the default KERNEL."
   (with-parser-context (token-scanner-context :scanner scanner)
-    (let ((centre-parser (cond (centre centre)
+    (let ((kernel-parser (cond (kernel kernel)
                               (abstractp (parser () (? :id)))
                               (t (parser () :id)))))
 
                                        (values t t nil))))
                           (lparen #\))))))
 
-              (centre ()
-                (parse (seq ((name (funcall centre-parser)))
+              (kernel ()
+                (parse (seq ((name (funcall kernel-parser)))
                          (cons #'identity name))))
 
               (argument-list ()
        (parse (seq ((value (expr (:nestedp nestedp)
 
                              ;; An actual operand.
-                             (centre)
+                             (kernel)
 
                              ;; Binary operators.  There aren't any.
                              nil
index 0eadfe6..a1095db 100644 (file)
@@ -294,6 +294,6 @@ int ftw(const char */*dirpath*/,
                      (c-type (func (* (func void (nil int)))
                                    (nil int)
                                    (nil (* (func void (nil int))))))
-                     "signal")))
+                     "signal"))
 
 ;;;----- That's all, folks --------------------------------------------------
index 2e66fa1..68c989b 100644 (file)
@@ -68,9 +68,9 @@
     ((slot sod-class-slot) slot-names &key pset)
   (declare (ignore slot-names))
   (default-slot (slot 'initializer-function)
-    (get-property pset :initializer-function t nil))
+    (get-property pset :initializer-function :func nil))
   (default-slot (slot 'prepare-function)
-    (get-property pset :prepare-function t nil)))
+    (get-property pset :prepare-function :func nil)))
 
 (export 'sod-class-effective-slot)
 (defclass sod-class-effective-slot (effective-slot)
index b093b82..f04bdd6 100644 (file)
@@ -78,8 +78,7 @@
                    stream
                    (make-instance 'position-aware-output-stream
                                   :stream stream
-                                  :file (or (stream-pathname stream)
-                                            #p"<unnamed>")))))
+                                  :file (stream-pathname stream)))))
     (hook-output module reason sequencer)
     (invoke-sequencer-items sequencer stream)))
 
index 5d26760..2fa13f1 100644 (file)
                 ;; names.
                 (parse-declarator
                  scanner base-type
-                 :centre (parser ()
+                 :kernel (parser ()
                            (seq ((name-a :id)
                                  (name-b (? (seq (#\. (id :id)) id))))
                              (if name-b (cons name-a name-b)
index 30d0c80..df42115 100644 (file)
@@ -35,8 +35,7 @@
 (defmethod ensure-sequencer-item ((sequencer sequencer) name)
   (with-slots (table) sequencer
     (or (gethash name table)
-       (setf (gethash name table)
-             (make-instance 'sequencer-item :name name)))))
+       (setf (gethash name table) (make-sequencer-item name)))))
 
 (defmethod add-sequencer-constraint ((sequencer sequencer) (constraint list))
   (let ((converted-constraint
index 141d0bc..d21b109 100644 (file)
@@ -38,7 +38,7 @@
 
   ;; Provide some default methods.  Most streams don't have a pathname.
   ;; File-based streams provide a pathname, but it's usually been merged with
-  ;; *DEFAULT-PATHNAME-DEFAULTS* or some such, which has made it absolute,
+  ;; `*default-pathname-defaults*' or some such, which has made it absolute,
   ;; which isn't ideal.  We'll hack around this in more useful classes later.
   (:method ((stream stream)) nil)
   (:method ((stream file-stream)) (pathname stream)))
index 91668ed..e98c908 100644 (file)
@@ -70,7 +70,8 @@
   (:method ((raw string)) (values :string raw))
   (:method ((raw character)) (values :char raw))
   (:method ((raw property)) (values (p-type raw) (p-value raw)))
-  (:method ((raw cons)) (values (car raw) (cdr raw))))
+  (:method ((raw cons)) (values (car raw) (cdr raw)))
+  (:method ((raw function)) (values :func raw)))
 
 (export 'make-property)
 (defun make-property (name raw-value &key type location seenp)
    Otherwise the value is coerced to the right kind of thing (where possible)
    and returned.
 
-   If PSET is nil, then return DEFAULT."
+   The file location at which the property was defined is returned as a
+   second value.
+
+   If PSET is nil, then return DEFAULT and nil."
 
   (let ((prop (and pset (pset-get pset (property-key name)))))
     (with-default-error-location ((and prop (p-location prop)))
index 0b7f6a7..d295c08 100644 (file)
    (: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" "classes"
-                                "c-types-impl" "c-types-class-impl"))
+   (:file "builtin" :depends-on
+         ("module-proto" "pset-proto" "c-types-impl" "c-types-class-impl"
+          "classes" "class-layout-proto"))
    (:file "module-parse" :depends-on
-         ("module-impl" "lexer-proto" "fragment-parse"))
+         ("class-make-proto" "class-finalize-proto"
+          "fragment-parse" "lexer-proto" "module-impl"))
    (:file "module-output" :depends-on ("module-impl" "output-proto"))
 
    ;; Output.