bool c-type
c-array-dimensions generic
c-array-type class
+ c-atomic-type class
c-enum-type class
c-function-arguments generic
+ c-function-keywords generic
c-function-type class
+ c-keyword-function-type class
c-pointer-type class
c-struct-type class
c-tagged-type-kind generic
c-type
c-array-type
c-function-type
+ c-keyword-function-type
+ c-storage-specifiers-type
qualifiable-c-type
+ c-atomic-type
c-pointer-type
simple-c-type
c-class-type
c-fragment
c-function-arguments
c-function-type
+c-function-keywords
+ c-keyword-function-type
+ c-qualifier-keyword
+ (eql :atomic)
+ cl:symbol
c-tagged-type-kind
c-enum-type
c-struct-type
c-type-equal-p
t t
c-array-type c-array-type
+ c-atomic-type c-atomic-type
c-class-type c-class-type
c-function-type c-function-type
+ c-keyword-function-type c-keyword-function-type
c-pointer-type c-pointer-type
+ c-storage-specifiers-type c-type
+ c-type c-storage-specifiers-type
qualifiable-c-type qualifiable-c-type
simple-c-type simple-c-type
tagged-c-type tagged-c-type
sod-class sod-class
compute-method-entry-functions
basic-effective-method
- simple-effective-method
+ effective-method
- simple-effective-method
compute-sod-effective-method
sod-message sod-class
compute-vtable
pprint-c-type
t t t
c-array-type t t
+ c-atomic-type t t
c-function-type t t
+ c-keyword-function-type t t
c-pointer-type t t
+ c-storage-specifiers-type t t
simple-c-type t t
tagged-c-type t t
primary-method-class
@|c-struct-type| \\
@|c-union-type| \\
@|c-enum-type| \- \\
+ @|c-atomic-type| \\
@|c-pointer-type| \- \\
@|c-array-type| \\
- @|c-function-type|
+ @|c-function-type| \\ \ind
+ @|c-keyword-function-type| \-
\end{tabbing}}
\caption{Classes representing C types}
\label{fig:codegen.c-types.classes}
const char *name; \\
const char *nick; \\
size_t initsz; \\
+ size_t align; \\
void *(*imprint)(void *@<p>); \\
- void *(*init)(void *@<p>); \\
size_t n_supers; \\
const SodClass *const *supers; \\
size_t n_cpl; \\
<argument> ::= @<declaration-specifier>^+ <argument-declarator>
-<abstract-declarator> ::= <declarator>$[\epsilon]$
++<abstract-declarator> ::= <declarator>$[\epsilon, \mbox{@<argument-list>}]$
+
+ <argument-declarator> ::= <declarator>$[\mbox{@<identifier> @! $\epsilon$}]$
+<argument-declarator> ::=
+ <declarator>$[\mbox{@<identifier> @! $\epsilon$}, \mbox{@<argument-list>}]$
-<simple-declarator> ::= <declarator>$[\mbox{@<identifier>}]$
-
-<dotted-name> ::= <identifier> "." <identifier>
+<simple-declarator> ::=
+ <declarator>$[\mbox{@<identifier>}, \mbox{@<argument-list>}]$
\end{grammar}
The declarator syntax is taken from C, but with some differences.
\h'8n'const char *name;
\h'8n'const char *nick;
\h'8n'size_t initsz;
+ \h'8n'size_t align;
\h'8n'void *(*imprint)(void *\fIp\fB);
-\h'8n'void *(*init)(void *\fIp\fB);
\h'8n'size_t n_supers;
\h'8n'const SodClass *const *supers;
\h'8n'size_t n_cpl;
/* We're going to want to make use of this ourselves. */
SOD__VARARGS_MACROS_PREAMBLE
+ /* --- @SOD__ALIGNOF@ --- *
+ *
+ * Arguments: @type@ = a C type name, consisting of declaration specifiers
+ * and `*[QUALIFIERS]' declarator operators
+ *
+ * Returns: A sufficient alignment for objects of the given @type@, as a
+ * @size_t@.
+ */
+
+ #if __STDC_VERSION__ >= 201112
+ # define SOD__ALIGNOF(type) _Alignof(type)
+ #elif SOD__GCC_P(4, 7)
+ # define SOD__ALIGNOF(type) __extension__ _Alignof(type)
+ #elif defined(__GNUC__)
+ # define SOD__ALIGNOF(type) __alignof__(type)
+ #else
+ # define SOD__ALIGNOF(type) \
+ offsetof(struct { char sod__x; type sod__y; }, sod__y)
+ #endif
+
+/* --- @SOD__IGNORE@ --- *
+ *
+ * Arguments: @var@ = some variable name
+ *
+ * Use: Suppress any warning that @var@ isn't used.
+ */
+
+#define SOD__IGNORE(var) ((void)(var))
+
/* --- @SOD__CAR@ --- *
*
* Arguments: @...@ = a nonempty list of arguments
.IR declaration-specifier \*+
.I argument-declarator
.br
-.IR declarator [\*e]
+ .I abstract-declarator
+ ::=
++.IR declarator "[\*e, " argument-list ]
+ .br
.I argument-declarator
::=
-.IR declarator [ identifier " | \*e]"
+.IR declarator [ identifier " | \*e, " argument-list ]
.br
.I simple-declarator
::=