X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/d21ac4d9a0768fa1acf8039a3e0e50b22924a488..b492babc8de898bd22d638d7c25f24356896a3a9:/doc/clang.tex diff --git a/doc/clang.tex b/doc/clang.tex index 99ad30a..58b8cd2 100644 --- a/doc/clang.tex +++ b/doc/clang.tex @@ -120,8 +120,9 @@ type specifier. Type specifiers fit into two syntactic categories. \end{describe} \begin{describe}{mac} - {defctype @{ @ @! (@ @^*) @} @ - @> @} + {defctype \=@{ @ @! (@^+) @} @ \+ \\ + @[[ @|:export| @ @]]^* \- + \nlret @} Defines a new symbolic type specifier @; if a list of @s is given, then all are defined in the same way. The type constructed by using any of the @s is as described by the type specifier @. @@ -129,6 +130,13 @@ type specifier. Type specifiers fit into two syntactic categories. The resulting type object is constructed once, at the time that the macro expansion is evaluated; the same (@|eq|) value is used each time any @ is used in a type specifier. + + A variable named @|c-type-@|, for the first @ only, is defined + and initialized to contain the C type object so constructed. Altering or + binding this name is discouraged. + + If @ is true, then the variable name, and all of the @s, + are exported from the current package. \end{describe} \begin{describe}{mac}{c-type-alias @ @^* @> @} @@ -410,13 +418,21 @@ In Sod, the leaf types are \end{describe} \begin{describe}{mac} - {define-simple-c-type @{ @ @! (@^*) @} @ @> @} + {define-simple-c-type \=@{ @ @! (@^+) @} @ \+ \\ + @[[ @|:export| @ @]] \- + \nlret @} Define type specifiers for a new simple C type. Each symbol @ is defined as a symbolic type specifier for the (unique interned) simple C type whose name is the value of @. Further, each @ is defined to be a type operator: the type specifier @|(@ @^*)| evaluates to the (unique interned) simple C type whose name is @ and which has the @ (which are evaluated). + + Furthermore, a variable @|c-type-@| is defined, for the first @ + only, and initialized with the newly constructed C type object. + + If @ is true, then the @|c-type-@| variable name, and + all of the @s, are exported from the current package. \end{describe} \begin{describe}{cls}{tagged-c-type (qualifiable-c-type) @@ -668,14 +684,19 @@ function type is the type of the function's return value. in the same order, and either both or neither argument list ends with @|:ellipsis|; argument names are not compared. - The type specifier @|(fun @ @{ (@ @) @}^* - @[:ellipsis @! . @
@])| constructs a function type. The function has - the subtype @. The remaining items in the type-specifier list - are used to construct the argument list. The argument items are a possibly - improper list, beginning with zero or more \emph{explicit arguments}: - two-item @/@ lists. For each such list, an @|argument| - object is constructed with the given name (evaluated) and type. Following - the explicit arguments, there may be + The type specifier + \begin{prog} + (fun @ + @{ (@ @) @}^* + @[:ellipsis @! . @@]) + \end{prog} + constructs a function type. The function has the subtype @. + The remaining items in the type-specifier list are used to construct the + argument list. The argument items are a possibly improper list, beginning + with zero or more \emph{explicit arguments}: two-item + @/@ lists. For each such list, an @|argument| object + is constructed with the given name (evaluated) and type. Following the + explicit arguments, there may be \begin{itemize} \item nothing, in which case the function's argument list consists only of the explicit arguments; @@ -838,8 +859,7 @@ Temporary names are represented by objects which implement a simple protocol. \begin{tabular}[C]{*2{>{\codeface}l}} \hlx*{hv} \thd{\textbf{Variable}} & \thd{\textbf{Name format}} \\ \hlx{vhv} {}*sod-ap* & sod__ap \\ - {}*sod-master-ap* & sod__master_ap \\ - {}*sod-tmp-ap* & sod__tmp_ap \\ \hlx*{vh} + {}*sod-master-ap* & sod__master_ap \\ \hlx*{vh} \end{tabular} \caption{Well-known temporary names} \label{tab:codegen.codegen.well-known-temps} @@ -884,12 +904,7 @@ Temporary names are represented by objects which implement a simple protocol. @|expr| & @ & @; \\ \hlx{v} @|call| & @ @ & @(@_1, $\ldots$, - @_n) \\ \hlx{v} - @|va-start| & @ @ & va_start(@, @); - \\ \hlx{v} - @|va-copy| & @ @ & va_copy(@, @); - \\ \hlx{v} - @|va-end| & @ & va_end(@); \\ \hlx{vhv} + @_n) \\ \hlx{vhv} @|block| & @ @ & \{ @[@@] @ \} \\ \hlx{v} @|if| & @ @ @ & if (@) @ @@ -925,7 +940,7 @@ Temporary names are represented by objects which implement a simple protocol. \begin{describe}{gf}{emit-decl @ @} \end{describe} -\begin{describe}{gf}{emit-declss @ @} +\begin{describe}{gf}{emit-decls @ @} \end{describe} \begin{describe}{gf}{codegen-push @} @@ -962,6 +977,10 @@ Temporary names are represented by objects which implement a simple protocol. \begin{describe}{fun}{deliver-expr @ @ @} \end{describe} +\begin{describe}{fun} + {deliver-call @ @ @ \&rest @} +\end{describe} + \begin{describe}{fun}{convert-stmts @ @ @ @} \end{describe}