144 keywords which have to be avoided for generated code. |
144 keywords which have to be avoided for generated code. |
145 However, if you consider \isa{adaption} mechanisms, the code generated |
145 However, if you consider \isa{adaption} mechanisms, the code generated |
146 by the serializer is just the tip of the iceberg: |
146 by the serializer is just the tip of the iceberg: |
147 |
147 |
148 \begin{itemize} |
148 \begin{itemize} |
149 \item parametrise \isa{serialisation} |
149 \item \isa{serialisation} can be \emph{parametrised} such that |
150 \item \isa{library} \isa{reserved} |
150 logical entities are mapped to target-specific ones |
151 \item \isa{includes} \isa{reserved} |
151 (e.g. target-specific list syntax, |
152 \end{itemize}% |
152 see also \secref{sec:adaption_mechanisms}) |
153 \end{isamarkuptext}% |
153 \item Such parametrisations can involve references to a |
154 \isamarkuptrue% |
154 target-specific standard \isa{library} (e.g. using |
155 % |
155 the \isa{Haskell} \verb|Maybe| type instead |
156 \isamarkupsubsection{Common adaption cases% |
156 of the \isa{HOL} \isa{option} type); |
|
157 if such are used, the corresponding identifiers |
|
158 (in our example, \verb|Maybe|, \verb|Nothing| |
|
159 and \verb|Just|) also have to be considered \isa{reserved}. |
|
160 \item Even more, the user can enrich the library of the |
|
161 target-language by providing code snippets |
|
162 (\qt{\isa{includes}}) which are prepended to |
|
163 any generated code (see \secref{sec:include}); this typically |
|
164 also involves further \isa{reserved} identifiers. |
|
165 \end{itemize} |
|
166 |
|
167 \noindent As figure \ref{fig:adaption} illustrates, all these adaption mechanisms |
|
168 have to act consistently; it is at the discretion of the user |
|
169 to take care for this.% |
|
170 \end{isamarkuptext}% |
|
171 \isamarkuptrue% |
|
172 % |
|
173 \isamarkupsubsection{Common adaption patterns% |
157 } |
174 } |
158 \isamarkuptrue% |
175 \isamarkuptrue% |
159 % |
176 % |
160 \begin{isamarkuptext}% |
177 \begin{isamarkuptext}% |
161 The \hyperlink{theory.HOL}{\mbox{\isa{HOL}}} \hyperlink{theory.Main}{\mbox{\isa{Main}}} theory already provides a code |
178 The \hyperlink{theory.HOL}{\mbox{\isa{HOL}}} \hyperlink{theory.Main}{\mbox{\isa{Main}}} theory already provides a code |