%%%----- Licensing notice ---------------------------------------------------
%%%
-%%% This file is part of the Sensble Object Design, an object system for C.
+%%% This file is part of the Sensible 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
Neither generic function defines a default primary method; subclasses of
@|c-type| must define their own methods in order to print correctly.
+
\subsection{The C type root class} \label{sec:clang.c-types.root}
\begin{describe}{cls}{c-type ()}
The class @|c-type| is abstract.
\end{describe}
+
\subsection{C type S-expression notation} \label{sec:clang.c-types.sexp}
The S-expression representation of a type is described syntactically as a
default method.
\end{describe}
+
\subsection{Comparing C types} \label{sec:clang.c-types.cmp}
It is necessary to compare C types for equality, for example when checking
\end{describe}
\end{describe}
+
\subsection{Outputting C types} \label{sec:clang.c-types.output}
\begin{describe}{gf}{pprint-c-type @<c-type> @<stream> @<kernel>}
within the @<form>s.
\end{describe}
+
\subsection{Type qualifiers and qualifiable types}
\label{sec:clang.ctypes.qual}
qualifiers; others keywords may be used, though this isn't recommended.
Two qualifiable types are equal only if they have \emph{matching
- qualifiers}: i.e., every qualifier attached to one is also attached to
- the other: order is not significant, and neither is multiplicity.
+ qualifiers}: i.e., every qualifier attached to one is also attached to the
+ other: order is not significant, and neither is multiplicity.
The class @|qualifiable-c-type| is abstract.
\end{describe}
non-null then the final character of the returned string will be a space.
\end{describe}
+
\subsection{Leaf types} \label{sec:clang.c-types.leaf}
A \emph{leaf type} is a type which is not defined in terms of another type.
\begin{tabular}[C]{ll} \hlx*{hv}
\thd{C type} & \thd{Specifiers} \\ \hlx{vhv}
@|void| & @|void| \\ \hlx{v}
- @|char| & @|char| \\ \hlx{v}
- @|unsigned char| & @|unsigned-char|, @|uchar| \\ \hlx{}
- @|signed char| & @|signed-char|, @|schar| \\ \hlx{v}
+ @|_Bool| & @|bool| \\ \hlx{v}
+ @|char| & @|char| \\ \hlx{}
+ @|wchar_t| & @|wchar-t| \\ \hlx{v}
+ @|signed char| & @|signed-char|, @|schar| \\ \hlx{}
+ @|unsigned char| & @|unsigned-char|, @|uchar| \\ \hlx{v}
@|short| & @|short|, @|signed-short|, @|short-int|,
@|signed-short-int| @|sshort| \\ \hlx{}
@|unsigned short| & @|unsigned-short|, @|unsigned-short-int|,
@|unsigned long| & @|unsigned-long|, @|unsigned-long-int|,
@|ulong| \\ \hlx{v}
@|long long| & @|long-long|, @|signed-long-long|,
- @|long-long-int|, \\
+ @|long-long-int|, \\ \hlx{}
& \qquad @|signed-long-long-int|,
@|llong|, @|sllong| \\ \hlx{v}
@|unsigned long long|
& @|unsigned-long-long|, @|unsigned-long-long-int|,
@|ullong| \\ \hlx{v}
+ @|size_t| & @|size-t| \\ \hlx{}
+ @|ptrdiff_t| & @|ptrdiff-t| \\ \hlx{v}
@|float| & @|float| \\ \hlx{}
- @|double| & @|double| \\ \hlx{v}
- @|va_list| & @|va-list| \\ \hlx{v}
- @|size_t| & @|size-t| \\ \hlx{v}
- @|ptrdiff_t| & @|ptrdiff-t| \\ \hlx*{vh}
+ @|double| & @|double| \\ \hlx{}
+ @|long double| & @|long-double| \\ \hlx{v}
+ @|float _Imaginary| & @|float-imaginary| \\ \hlx{}
+ @|double _Imaginary|& @|double-imaginary| \\ \hlx{}
+ @|long double _Imaginary|
+ & @|long-double-imaginary| \\ \hlx{v}
+ @|float _Complex| & @|float-complex| \\ \hlx{}
+ @|double _Complex| & @|double-complex| \\ \hlx{}
+ @|long double _Complex|
+ & @|long-double-complex| \\ \hlx{v}
+ @|va_list| & @|va-list| \\ \hlx*{vh}
\end{tabular}
\caption{Builtin symbolic type specifiers for simple C types}
\label{tab:codegen.c-types.simple}
keywords).
\end{describe}
+
\subsection{Compound C types} \label{sec:code.c-types.compound}
Some C types are \emph{compound types}: they're defined in terms of existing
this means depends on the class of @<c-type>.
\end{describe}
+
\subsection{Pointer types} \label{sec:clang.c-types.pointer}
Pointers compound types. The subtype of a pointer type is the type it points
interned also.
\end{describe}
+
\subsection{Array types} \label{sec:clang.c-types.array}
Arrays implement the compound-type protocol. The subtype of an array type is
Returns the dimensions of @<c-type>, an array type, as an immutable list.
\end{describe}
+
\subsection{Function types} \label{sec:clang.c-types.fun}
Function types implement the compound-type protocol. The subtype of a
argument name.
\end{describe}
-\begin{describe}{fun}{argument-name @<argument> @> @<name>}
- Return the name of the @<argument>, as it was supplied to @|make-argument|.
-\end{describe}
-
-\begin{describe}{fun}{argument-type @<argument> @> @<c-type>}
- Return the type of the @<argument>, as it was supplied to @|make-argument|.
-\end{describe}
+\begin{describe*}
+ {\dhead{fun}{argument-name @<argument> @> @<name>}
+ \dhead{fun}{argument-type @<argument> @> @<c-type>}}
+ Accessor functions for @|argument| objects. They return the name (for
+ @|argument-name|) or type (for @|argument-type|) from the object, as passed
+ to @|make-argument|.
+\end{describe*}
\begin{describe}{gf}
{commentify-argument-name @<name> @> @<commentified-name>}
@|commentify-argument-names| to the argument list of the given type.
\end{describe}
+
\subsection{Parsing C types} \label{sec:clang.c-types.parsing}
+\begin{describe}{fun}
+ {parse-c-type @<scanner>
+ @> @<result> @<success-flag> @<consumed-flag>}
+\end{describe}
+
+\begin{describe}{fun}
+ {parse-declarator @<scanner> @<base-type> \&key :kernel :abstractp
+ \nlret @<result> @<success-flag> @<consumed-flag>}
+\end{describe}
+
+
+\subsection{Class types} \label{sec:clang.c-types.class}
+
+\begin{describe}{cls}
+ {c-class-type (simple-c-type) \&key :class :tag :qualifiers :name}
+\end{describe}
+
+\begin{describe*}
+ {\dhead{gf}{c-type-class @<class-type> @> @<class>}
+ \dhead{gf}{setf (c-type-class @<class-type>) @<class>}}
+\end{describe*}
+
+\begin{describe}{fun}{find-class-type @<name> @> @<class-type-or-nil>}
+\end{describe}
+
+\begin{describe}{fun}
+ {make-class-type @<name> \&optional @<qualifiers> @> @<class-type>}
+\end{describe}
+
+\begin{describe}{fun}
+ {make-class-type @<name> \&optional @<qualifiers> @> @<class-type>}
+\end{describe}
+
+\begin{describe}{fun}{find-sod-class @<name> @> @<class>}
+\end{describe}
+
+\begin{describe}{fun}{record-sod-class @<class>}
+\end{describe}
+
%%%--------------------------------------------------------------------------
\section{Generating C code} \label{sec:clang.codegen}
This section deals with Sod's facilities for constructing and manipulating C
expressions, declarations, instructions and definitions.
+
\subsection{Temporary names} \label{sec:clang.codegen.temporaries}
Many C-level objects, especially ones with external linkage or inclusion in a
\label{tab:codegen.codegen.well-known-temps}
\end{table}
+
\subsection{Instructions} \label{sec:clang.codegen.insts}
\begin{describe}{cls}{inst () \&key}
\label{tab:codegen.codegen.insts}
\end{table}
+
\subsection{Code generation} \label{sec:clang.codegen.codegen}
\begin{describe}{gf}{codegen-functions @<codegen> @> @<list>}
\nlret @<result> @<success-flag> @<consumed-flag>}
\end{describe}
-\relax
%%%----- That's all, folks --------------------------------------------------
%%% Local variables: