chiark / gitweb /
doc/clang.tex, doc/layout.tex: Add labels and indexing for things in tables.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 7 Aug 2019 16:26:42 +0000 (17:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 7 Aug 2019 16:31:24 +0000 (17:31 +0100)
The simple C types, instruction types, and temporary names lacked
description entries.  Use the new `\desclabel' to arrange index entries
and labels.

doc/clang.tex
doc/layout.tex

index 7399258053c47a1c4b7add56347c30baf159e265..f5ccbb1913c9e8f3e2c5df31616beefe6221a04e 100644 (file)
@@ -501,6 +501,16 @@ In Sod, the leaf types are
   Two simple type objects are equal if and only if they have @|string=| names
   and matching qualifiers.
 
+  \def\x#1{\desclabel{const}{#1}}
+  \x{c-type-bool} \x{c-type-char} \x{c-type-wchar-t} \x{c-type-signed-char}
+  \x{c-type-unsigned-char} \x{c-type-short} \x{c-type-unsigned-short}
+  \x{c-type-int} \x{c-type-unsigned} \x{c-type-long} \x{c-type-unsigned-long}
+  \x{c-type-long-long} \x{c-type-unsigned-long-long} \x{c-type-size-t}
+  \x{c-type-ptrdiff-t} \x{c-type-float} \x{c-type-double}
+  \x{c-type-long-double} \x{c-type-float-imaginary}
+  \x{c-type-double-imaginary} \x{c-type-long-double-imaginary}
+  \x{c-type-float-complex} \x{c-type-double-complex}
+  \x{c-type-long-double-complex} \x{c-type-va-list} \x{c-type-void}
   A number of symbolic type specifiers for builtin types are predefined as
   shown in \xref{tab:codegen.c-types.simple}.  These are all defined as if by
   @|define-simple-c-type|, so can be used to construct qualified types.
@@ -1199,6 +1209,8 @@ Temporary names are represented by objects which implement a simple protocol.
 \subsubsection{Well-known `temporary' names}
 
 \begin{table}
+  \def\x#1{\desclabel{var}{#1}}
+  \x{*sod-ap*} \x{*sod-master-ap*} \x{*null-pointer*}
   \begin{tabular}[C]{*2{>{\codeface}l}}                            \hlx*{hv}
     \thd{\textbf{Variable}} & \thd{\textbf{Name format}}        \\ \hlx{vhv}
     {}*sod-ap*                  & sod__ap                       \\
@@ -1284,6 +1296,33 @@ Temporary names are represented by objects which implement a simple protocol.
   \label{tab:codegen.codegen.insts}
 \end{table}
 
+\begin{describe*}
+    {\dhead*{cls}{@<code>-inst (inst) \&key \dots}
+     \dhead*{fn}{make-@<code>-inst \dots}
+     \dhead*{gf}{inst-@<slot> @<inst> @> @<value>}}
+  \def\instclass#1#2#3{%
+    #1{cls}{#3-inst}[#2]%
+    #1{fun}{make-#3-inst}[#2]%
+  }
+  \def\instslot#1#2#3{#1{gf}{inst-#3}[#2]}
+  \def\makelabels#1#2{%
+    \def\x{\instclass{#1}{#2}}
+      \x{var} \x{set} \x{update} \x{cond} \x{return} \x{break} \x{continue}
+      \x{expr} \x{call} \x{banner} \x{block} \x{if} \x{for} \x{while}
+      \x{do-while} \x{function}
+    \def\x{\instslot{#1}{#2}}
+      \x{name} \x{type} \x{init} \x{var} \x{expr} \x{op} \x{cond} \x{conseq}
+      \x{alt} \x{func} \x{args} \x{control} \x{decls} \x{body} \x{update}
+      \x{banner} \x{banner-args}
+  }
+  \makelabels{\desclabel}{|(}
+
+  Sod provides a number of built-in instruction types generated by
+  \descref{mac}{definst}: see \xref{tab:codegen.codegen.insts}.
+
+  \makelabels{\descindex}{|)}
+\end{describe*}
+
 
 \subsection{Code generation} \label{sec:clang.codegen.codegen}
 
index da4ee3857b884bf8b22a6c71dd7ad8272a9215d5..cdad4688f323bf0cafa94c161c4c13e636af047e 100644 (file)
     {\dhead{cls}{convert-to-ilayout-inst (inst)}
      \dhead{fun}
        {make-convert-to-ilayout-inst @<class> @<chain-head> @<expr>}}
+  \def\makelabels#1#2{%
+    #1{gf}{inst-class}[#2]#1{gf}{inst-chain-head}[#2]%
+    \descindex{gf}{inst-expr}[#2]%
+  }
+  \makelabels{\desclabel}{|(}
+
   \begin{prog}
     SOD_ILAYOUT(@<class>, @<chain-head-nick>, @<expr>)
   \end{prog}
+
+  \makelabels{\descindex}{|)}
 \end{describe*}