author | bulwahn |
Tue, 08 May 2012 14:31:03 +0200 | |
changeset 47893 | 4cf901b1089a |
parent 47828 | e6e1b670520b |
child 48577 | 1edc81c78079 |
permissions | -rw-r--r-- |
28224 | 1 |
% |
2 |
\begin{isabellebody}% |
|
3 |
\def\isabellecontext{Misc}% |
|
4 |
% |
|
5 |
\isadelimtheory |
|
6 |
% |
|
7 |
\endisadelimtheory |
|
8 |
% |
|
9 |
\isatagtheory |
|
10 |
\isacommand{theory}\isamarkupfalse% |
|
11 |
\ Misc\isanewline |
|
43564
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
41512
diff
changeset
|
12 |
\isakeyword{imports}\ Base\isanewline |
28224 | 13 |
\isakeyword{begin}% |
14 |
\endisatagtheory |
|
15 |
{\isafoldtheory}% |
|
16 |
% |
|
17 |
\isadelimtheory |
|
18 |
% |
|
19 |
\endisadelimtheory |
|
20 |
% |
|
21 |
\isamarkupchapter{Miscellaneous tools \label{ch:tools}% |
|
22 |
} |
|
23 |
\isamarkuptrue% |
|
24 |
% |
|
25 |
\begin{isamarkuptext}% |
|
26 |
Subsequently we describe various Isabelle related utilities, given |
|
27 |
in alphabetical order.% |
|
28 |
\end{isamarkuptext}% |
|
29 |
\isamarkuptrue% |
|
30 |
% |
|
31 |
\isamarkupsection{Displaying documents% |
|
32 |
} |
|
33 |
\isamarkuptrue% |
|
34 |
% |
|
35 |
\begin{isamarkuptext}% |
|
36 |
The \indexdef{}{tool}{display}\hypertarget{tool.display}{\hyperlink{tool.display}{\mbox{\isa{\isatt{display}}}}} utility displays documents in DVI or PDF |
|
37 |
format: |
|
38 |
\begin{ttbox} |
|
39 |
Usage: display [OPTIONS] FILE |
|
40 |
||
41 |
Options are: |
|
42 |
-c cleanup -- remove FILE after use |
|
43 |
||
44 |
Display document FILE (in DVI format). |
|
45 |
\end{ttbox} |
|
46 |
||
47 |
\medskip The \verb|-c| option causes the input file to be |
|
48 |
removed after use. The program for viewing \verb|dvi| files is |
|
40406 | 49 |
determined by the \hyperlink{setting.DVI-VIEWER}{\mbox{\isa{\isatt{DVI{\isaliteral{5F}{\isacharunderscore}}VIEWER}}}} setting.% |
28224 | 50 |
\end{isamarkuptext}% |
51 |
\isamarkuptrue% |
|
52 |
% |
|
53 |
\isamarkupsection{Viewing documentation \label{sec:tool-doc}% |
|
54 |
} |
|
55 |
\isamarkuptrue% |
|
56 |
% |
|
57 |
\begin{isamarkuptext}% |
|
58 |
The \indexdef{}{tool}{doc}\hypertarget{tool.doc}{\hyperlink{tool.doc}{\mbox{\isa{\isatt{doc}}}}} utility displays online documentation: |
|
59 |
\begin{ttbox} |
|
60 |
Usage: doc [DOC] |
|
61 |
||
62 |
View Isabelle documentation DOC, or show list of available documents. |
|
63 |
\end{ttbox} |
|
64 |
If called without arguments, it lists all available documents. Each |
|
65 |
line starts with an identifier, followed by a short description. Any |
|
66 |
of these identifiers may be specified as the first argument in order |
|
67 |
to have the corresponding document displayed. |
|
68 |
||
40406 | 69 |
\medskip The \hyperlink{setting.ISABELLE-DOCS}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}DOCS}}}} setting specifies the list of |
28224 | 70 |
directories (separated by colons) to be scanned for documentations. |
71 |
The program for viewing \verb|dvi| files is determined by the |
|
40406 | 72 |
\hyperlink{setting.DVI-VIEWER}{\mbox{\isa{\isatt{DVI{\isaliteral{5F}{\isacharunderscore}}VIEWER}}}} setting.% |
28224 | 73 |
\end{isamarkuptext}% |
74 |
\isamarkuptrue% |
|
75 |
% |
|
47828 | 76 |
\isamarkupsection{Shell commands within the settings environment \label{sec:tool-env}% |
77 |
} |
|
78 |
\isamarkuptrue% |
|
79 |
% |
|
80 |
\begin{isamarkuptext}% |
|
81 |
The \indexdef{}{tool}{env}\hypertarget{tool.env}{\hyperlink{tool.env}{\mbox{\isa{\isatt{env}}}}} utility is a direct wrapper for the |
|
82 |
standard \verb|/usr/bin/env| command on POSIX systems, |
|
83 |
running within the Isabelle settings environment |
|
84 |
(\secref{sec:settings}). |
|
85 |
||
86 |
The command-line arguments are that of the underlying version of |
|
87 |
\verb|env|. For example, the following invokes an instance of |
|
88 |
the GNU Bash shell within the Isabelle environment: |
|
89 |
\begin{alltt} |
|
90 |
isabelle env bash |
|
91 |
\end{alltt}% |
|
92 |
\end{isamarkuptext}% |
|
93 |
\isamarkuptrue% |
|
94 |
% |
|
28224 | 95 |
\isamarkupsection{Getting logic images% |
96 |
} |
|
97 |
\isamarkuptrue% |
|
98 |
% |
|
99 |
\begin{isamarkuptext}% |
|
100 |
The \indexdef{}{tool}{findlogics}\hypertarget{tool.findlogics}{\hyperlink{tool.findlogics}{\mbox{\isa{\isatt{findlogics}}}}} utility traverses all directories |
|
40406 | 101 |
specified in \hyperlink{setting.ISABELLE-PATH}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}PATH}}}}, looking for Isabelle logic |
28224 | 102 |
images. Its usage is: |
103 |
\begin{ttbox} |
|
104 |
Usage: findlogics |
|
105 |
||
106 |
Collect heap file names from ISABELLE_PATH. |
|
107 |
\end{ttbox} |
|
108 |
||
109 |
The base names of all files found on the path are printed --- sorted |
|
40406 | 110 |
and with duplicates removed. Also note that lookup in \hyperlink{setting.ISABELLE-PATH}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}PATH}}}} includes the current values of \hyperlink{setting.ML-SYSTEM}{\mbox{\isa{\isatt{ML{\isaliteral{5F}{\isacharunderscore}}SYSTEM}}}} |
111 |
and \hyperlink{setting.ML-PLATFORM}{\mbox{\isa{\isatt{ML{\isaliteral{5F}{\isacharunderscore}}PLATFORM}}}}. Thus switching to another ML compiler |
|
28224 | 112 |
may change the set of logic images available.% |
113 |
\end{isamarkuptext}% |
|
114 |
\isamarkuptrue% |
|
115 |
% |
|
116 |
\isamarkupsection{Inspecting the settings environment \label{sec:tool-getenv}% |
|
117 |
} |
|
118 |
\isamarkuptrue% |
|
119 |
% |
|
120 |
\begin{isamarkuptext}% |
|
121 |
The Isabelle settings environment --- as provided by the |
|
122 |
site-default and user-specific settings files --- can be inspected |
|
123 |
with the \indexdef{}{tool}{getenv}\hypertarget{tool.getenv}{\hyperlink{tool.getenv}{\mbox{\isa{\isatt{getenv}}}}} utility: |
|
124 |
\begin{ttbox} |
|
125 |
Usage: getenv [OPTIONS] [VARNAMES ...] |
|
126 |
||
127 |
Options are: |
|
128 |
-a display complete environment |
|
129 |
-b print values only (doesn't work for -a) |
|
31497 | 130 |
-d FILE dump complete environment to FILE |
131 |
(null terminated entries) |
|
28224 | 132 |
|
133 |
Get value of VARNAMES from the Isabelle settings. |
|
134 |
\end{ttbox} |
|
135 |
||
136 |
With the \verb|-a| option, one may inspect the full process |
|
137 |
environment that Isabelle related programs are run in. This usually |
|
138 |
contains much more variables than are actually Isabelle settings. |
|
139 |
Normally, output is a list of lines of the form \isa{name}\verb|=|\isa{value}. The \verb|-b| option |
|
31497 | 140 |
causes only the values to be printed. |
141 |
||
142 |
Option \verb|-d| produces a dump of the complete environment |
|
143 |
to the specified file. Entries are terminated by the ASCII null |
|
144 |
character, i.e.\ the C string terminator.% |
|
28224 | 145 |
\end{isamarkuptext}% |
146 |
\isamarkuptrue% |
|
147 |
% |
|
148 |
\isamarkupsubsubsection{Examples% |
|
149 |
} |
|
150 |
\isamarkuptrue% |
|
151 |
% |
|
152 |
\begin{isamarkuptext}% |
|
153 |
Get the ML system name and the location where the compiler binaries |
|
154 |
are supposed to reside as follows: |
|
155 |
\begin{ttbox} |
|
28505 | 156 |
isabelle getenv ML_SYSTEM ML_HOME |
28224 | 157 |
{\out ML_SYSTEM=polyml} |
158 |
{\out ML_HOME=/usr/share/polyml/x86-linux} |
|
159 |
\end{ttbox} |
|
160 |
||
161 |
The next one peeks at the output directory for Isabelle logic |
|
162 |
images: |
|
163 |
\begin{ttbox} |
|
28505 | 164 |
isabelle getenv -b ISABELLE_OUTPUT |
28224 | 165 |
{\out /home/me/isabelle/heaps/polyml_x86-linux} |
166 |
\end{ttbox} |
|
167 |
Here we have used the \verb|-b| option to suppress the |
|
168 |
\verb|ISABELLE_OUTPUT=| prefix. The value above is what |
|
169 |
became of the following assignment in the default settings file: |
|
170 |
\begin{ttbox} |
|
171 |
ISABELLE_OUTPUT="\$ISABELLE_HOME_USER/heaps" |
|
172 |
\end{ttbox} |
|
173 |
||
40406 | 174 |
Note how the \hyperlink{setting.ML-IDENTIFIER}{\mbox{\isa{\isatt{ML{\isaliteral{5F}{\isacharunderscore}}IDENTIFIER}}}} value got appended |
28224 | 175 |
automatically to each path component. This is a special feature of |
40406 | 176 |
\hyperlink{setting.ISABELLE-OUTPUT}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}OUTPUT}}}}.% |
28224 | 177 |
\end{isamarkuptext}% |
178 |
\isamarkuptrue% |
|
179 |
% |
|
180 |
\isamarkupsection{Installing standalone Isabelle executables \label{sec:tool-install}% |
|
181 |
} |
|
182 |
\isamarkuptrue% |
|
183 |
% |
|
184 |
\begin{isamarkuptext}% |
|
28505 | 185 |
By default, the main Isabelle binaries (\hyperlink{executable.isabelle}{\mbox{\isa{\isatt{isabelle}}}} |
186 |
etc.) are just run from their location within the distribution |
|
187 |
directory, probably indirectly by the shell through its \hyperlink{setting.PATH}{\mbox{\isa{\isatt{PATH}}}}. Other schemes of installation are supported by the |
|
188 |
\indexdef{}{tool}{install}\hypertarget{tool.install}{\hyperlink{tool.install}{\mbox{\isa{\isatt{install}}}}} utility: |
|
28224 | 189 |
\begin{ttbox} |
190 |
Usage: install [OPTIONS] |
|
191 |
||
192 |
Options are: |
|
193 |
-d DISTDIR use DISTDIR as Isabelle distribution |
|
194 |
(default ISABELLE_HOME) |
|
195 |
-p DIR install standalone binaries in DIR |
|
196 |
||
197 |
Install Isabelle executables with absolute references to the current |
|
198 |
distribution directory. |
|
199 |
\end{ttbox} |
|
200 |
||
201 |
The \verb|-d| option overrides the current Isabelle |
|
40406 | 202 |
distribution directory as determined by \hyperlink{setting.ISABELLE-HOME}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}HOME}}}}. |
28224 | 203 |
|
204 |
The \verb|-p| option installs executable wrapper scripts for |
|
40406 | 205 |
\hyperlink{executable.isabelle-process}{\mbox{\isa{\isatt{isabelle{\isaliteral{2D}{\isacharminus}}process}}}}, \hyperlink{executable.isabelle}{\mbox{\isa{\isatt{isabelle}}}}, |
28238 | 206 |
\hyperlink{executable.Isabelle}{\mbox{\isa{\isatt{Isabelle}}}}, containing proper absolute references to the |
207 |
Isabelle distribution directory. A typical \verb|DIR| |
|
208 |
specification would be some directory expected to be in the shell's |
|
209 |
\hyperlink{setting.PATH}{\mbox{\isa{\isatt{PATH}}}}, such as \verb|/usr/local/bin|. It is |
|
210 |
important to note that a plain manual copy of the original Isabelle |
|
211 |
executables does not work, since it disrupts the integrity of the |
|
212 |
Isabelle distribution.% |
|
28224 | 213 |
\end{isamarkuptext}% |
214 |
\isamarkuptrue% |
|
215 |
% |
|
216 |
\isamarkupsection{Creating instances of the Isabelle logo% |
|
217 |
} |
|
218 |
\isamarkuptrue% |
|
219 |
% |
|
220 |
\begin{isamarkuptext}% |
|
221 |
The \indexdef{}{tool}{logo}\hypertarget{tool.logo}{\hyperlink{tool.logo}{\mbox{\isa{\isatt{logo}}}}} utility creates any instance of the generic |
|
222 |
Isabelle logo as an Encapsuled Postscript file (EPS): |
|
223 |
\begin{ttbox} |
|
224 |
Usage: logo [OPTIONS] NAME |
|
225 |
||
226 |
Create instance NAME of the Isabelle logo (as EPS). |
|
227 |
||
228 |
Options are: |
|
229 |
-o OUTFILE set output file (default determined from NAME) |
|
230 |
-q quiet mode |
|
231 |
\end{ttbox} |
|
232 |
You are encouraged to use this to create a derived logo for your |
|
28505 | 233 |
Isabelle project. For example, \verb|isabelle| \hyperlink{tool.logo}{\mbox{\isa{\isatt{logo}}}}~\verb|Bali| creates \verb|isabelle_bali.eps|.% |
28224 | 234 |
\end{isamarkuptext}% |
235 |
\isamarkuptrue% |
|
236 |
% |
|
237 |
\isamarkupsection{Isabelle's version of make \label{sec:tool-make}% |
|
238 |
} |
|
239 |
\isamarkuptrue% |
|
240 |
% |
|
241 |
\begin{isamarkuptext}% |
|
242 |
The Isabelle \indexdef{}{tool}{make}\hypertarget{tool.make}{\hyperlink{tool.make}{\mbox{\isa{\isatt{make}}}}} utility is a very simple wrapper for |
|
243 |
ordinary Unix \hyperlink{executable.make}{\mbox{\isa{\isatt{make}}}}: |
|
244 |
\begin{ttbox} |
|
245 |
Usage: make [ARGS ...] |
|
246 |
||
247 |
Compile the logic in current directory using IsaMakefile. |
|
248 |
ARGS are directly passed to the system make program. |
|
249 |
\end{ttbox} |
|
250 |
||
251 |
Note that the Isabelle settings environment is also active. Thus one |
|
252 |
may refer to its values within the \verb|IsaMakefile|, e.g.\ |
|
253 |
\verb|$(ISABELLE_OUTPUT)|. Furthermore, programs started from |
|
254 |
the make file also inherit this environment. Typically, \verb|IsaMakefile|s defer the real work to the \indexref{}{tool}{usedir}\hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} utility. |
|
255 |
||
256 |
\medskip The basic \verb|IsaMakefile| convention is that the |
|
257 |
default target builds the actual logic, including its parents if |
|
258 |
appropriate. The \verb|images| target is intended to build all |
|
259 |
local logic images, while the \verb|test| target shall build |
|
260 |
all related examples. The \verb|all| target shall do |
|
261 |
\verb|images| and \verb|test|.% |
|
262 |
\end{isamarkuptext}% |
|
263 |
\isamarkuptrue% |
|
264 |
% |
|
265 |
\isamarkupsubsubsection{Examples% |
|
266 |
} |
|
267 |
\isamarkuptrue% |
|
268 |
% |
|
269 |
\begin{isamarkuptext}% |
|
270 |
Refer to the \verb|IsaMakefile|s of the Isabelle distribution's |
|
271 |
object-logics as a model for your own developments. For example, |
|
40802 | 272 |
see \verb|~~/src/FOL/IsaMakefile|.% |
28224 | 273 |
\end{isamarkuptext}% |
274 |
\isamarkuptrue% |
|
275 |
% |
|
276 |
\isamarkupsection{Make all logics% |
|
277 |
} |
|
278 |
\isamarkuptrue% |
|
279 |
% |
|
280 |
\begin{isamarkuptext}% |
|
32325 | 281 |
The \indexdef{}{tool}{makeall}\hypertarget{tool.makeall}{\hyperlink{tool.makeall}{\mbox{\isa{\isatt{makeall}}}}} utility applies Isabelle make to any |
282 |
Isabelle component (cf.\ \secref{sec:components}) that contains an |
|
283 |
\verb|IsaMakefile|: |
|
28224 | 284 |
\begin{ttbox} |
285 |
Usage: makeall [ARGS ...] |
|
286 |
||
32325 | 287 |
Apply isabelle make to all components with IsaMakefile (passing ARGS). |
28224 | 288 |
\end{ttbox} |
289 |
||
290 |
The arguments \verb|ARGS| are just passed verbatim to each |
|
291 |
\hyperlink{tool.make}{\mbox{\isa{\isatt{make}}}} invocation.% |
|
292 |
\end{isamarkuptext}% |
|
293 |
\isamarkuptrue% |
|
294 |
% |
|
295 |
\isamarkupsection{Printing documents% |
|
296 |
} |
|
297 |
\isamarkuptrue% |
|
298 |
% |
|
299 |
\begin{isamarkuptext}% |
|
300 |
The \indexdef{}{tool}{print}\hypertarget{tool.print}{\hyperlink{tool.print}{\mbox{\isa{\isatt{print}}}}} utility prints documents: |
|
301 |
\begin{ttbox} |
|
302 |
Usage: print [OPTIONS] FILE |
|
303 |
||
304 |
Options are: |
|
305 |
-c cleanup -- remove FILE after use |
|
306 |
||
307 |
Print document FILE. |
|
308 |
\end{ttbox} |
|
309 |
||
310 |
The \verb|-c| option causes the input file to be removed |
|
40406 | 311 |
after use. The printer spool command is determined by the \hyperlink{setting.PRINT-COMMAND}{\mbox{\isa{\isatt{PRINT{\isaliteral{5F}{\isacharunderscore}}COMMAND}}}} setting.% |
28224 | 312 |
\end{isamarkuptext}% |
313 |
\isamarkuptrue% |
|
314 |
% |
|
315 |
\isamarkupsection{Remove awkward symbol names from theory sources% |
|
316 |
} |
|
317 |
\isamarkuptrue% |
|
318 |
% |
|
319 |
\begin{isamarkuptext}% |
|
320 |
The \indexdef{}{tool}{unsymbolize}\hypertarget{tool.unsymbolize}{\hyperlink{tool.unsymbolize}{\mbox{\isa{\isatt{unsymbolize}}}}} utility tunes Isabelle theory sources to |
|
321 |
improve readability for plain ASCII output (e.g.\ in email |
|
322 |
communication). Most notably, \hyperlink{tool.unsymbolize}{\mbox{\isa{\isatt{unsymbolize}}}} replaces awkward |
|
323 |
arrow symbols such as \verb|\|\verb|<Longrightarrow>| |
|
324 |
by \verb|==>|. |
|
325 |
\begin{ttbox} |
|
326 |
Usage: unsymbolize [FILES|DIRS...] |
|
327 |
||
328 |
Recursively find .thy/.ML files, removing unreadable symbol names. |
|
329 |
Note: this is an ad-hoc script; there is no systematic way to replace |
|
330 |
symbols independently of the inner syntax of a theory! |
|
331 |
||
332 |
Renames old versions of FILES by appending "~~". |
|
333 |
\end{ttbox}% |
|
334 |
\end{isamarkuptext}% |
|
335 |
\isamarkuptrue% |
|
336 |
% |
|
337 |
\isamarkupsection{Output the version identifier of the Isabelle distribution% |
|
338 |
} |
|
339 |
\isamarkuptrue% |
|
340 |
% |
|
341 |
\begin{isamarkuptext}% |
|
41511 | 342 |
The \indexdef{}{tool}{version}\hypertarget{tool.version}{\hyperlink{tool.version}{\mbox{\isa{\isatt{version}}}}} utility displays Isabelle version information: |
343 |
\begin{ttbox} |
|
344 |
Usage: isabelle version [OPTIONS] |
|
345 |
||
346 |
Options are: |
|
347 |
-i short identification (derived from Mercurial id) |
|
348 |
||
349 |
Display Isabelle version information. |
|
350 |
\end{ttbox} |
|
351 |
||
352 |
\medskip The default is to output the full version string of the |
|
47827 | 353 |
Isabelle distribution, e.g.\ ``\verb|Isabelle2012: May 2012|. |
41511 | 354 |
|
355 |
The \verb|-i| option produces a short identification derived |
|
356 |
from the Mercurial id of the \hyperlink{setting.ISABELLE-HOME}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}HOME}}}} directory.% |
|
28224 | 357 |
\end{isamarkuptext}% |
358 |
\isamarkuptrue% |
|
359 |
% |
|
360 |
\isamarkupsection{Convert XML to YXML% |
|
361 |
} |
|
362 |
\isamarkuptrue% |
|
363 |
% |
|
364 |
\begin{isamarkuptext}% |
|
365 |
The \indexdef{}{tool}{yxml}\hypertarget{tool.yxml}{\hyperlink{tool.yxml}{\mbox{\isa{\isatt{yxml}}}}} tool converts a standard XML document (stdin) |
|
366 |
to the much simpler and more efficient YXML format of Isabelle |
|
367 |
(stdout). The YXML format is defined as follows. |
|
368 |
||
369 |
\begin{enumerate} |
|
370 |
||
371 |
\item The encoding is always UTF-8. |
|
372 |
||
373 |
\item Body text is represented verbatim (no escaping, no special |
|
374 |
treatment of white space, no named entities, no CDATA chunks, no |
|
375 |
comments). |
|
376 |
||
377 |
\item Markup elements are represented via ASCII control characters |
|
40406 | 378 |
\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E626F6C643E}{}\isactrlbold X\ {\isaliteral{3D}{\isacharequal}}\ {\isadigit{5}}{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E626F6C643E}{}\isactrlbold Y\ {\isaliteral{3D}{\isacharequal}}\ {\isadigit{6}}{\isaliteral{22}{\isachardoublequote}}} as follows: |
28224 | 379 |
|
380 |
\begin{tabular}{ll} |
|
381 |
XML & YXML \\\hline |
|
40406 | 382 |
\verb|<|\isa{{\isaliteral{22}{\isachardoublequote}}name\ attribute{\isaliteral{22}{\isachardoublequote}}}\verb|=|\isa{{\isaliteral{22}{\isachardoublequote}}value\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}}\verb|>| & |
383 |
\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E626F6C643E}{}\isactrlbold X\isaliteral{5C3C5E626F6C643E}{}\isactrlbold Yname\isaliteral{5C3C5E626F6C643E}{}\isactrlbold Yattribute{\isaliteral{22}{\isachardoublequote}}}\verb|=|\isa{{\isaliteral{22}{\isachardoublequote}}value{\isaliteral{5C3C646F74733E}{\isasymdots}}\isaliteral{5C3C5E626F6C643E}{}\isactrlbold X{\isaliteral{22}{\isachardoublequote}}} \\ |
|
384 |
\verb|</|\isa{name}\verb|>| & \isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E626F6C643E}{}\isactrlbold X\isaliteral{5C3C5E626F6C643E}{}\isactrlbold Y\isaliteral{5C3C5E626F6C643E}{}\isactrlbold X{\isaliteral{22}{\isachardoublequote}}} \\ |
|
28224 | 385 |
\end{tabular} |
386 |
||
387 |
There is no special case for empty body text, i.e.\ \verb|<foo/>| is treated like \verb|<foo></foo>|. Also note that |
|
40406 | 388 |
\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E626F6C643E}{}\isactrlbold X{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E626F6C643E}{}\isactrlbold Y{\isaliteral{22}{\isachardoublequote}}} may never occur in |
28224 | 389 |
well-formed XML documents. |
390 |
||
391 |
\end{enumerate} |
|
392 |
||
393 |
Parsing YXML is pretty straight-forward: split the text into chunks |
|
40406 | 394 |
separated by \isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E626F6C643E}{}\isactrlbold X{\isaliteral{22}{\isachardoublequote}}}, then split each chunk into |
395 |
sub-chunks separated by \isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E626F6C643E}{}\isactrlbold Y{\isaliteral{22}{\isachardoublequote}}}. Markup chunks start |
|
28224 | 396 |
with an empty sub-chunk, and a second empty sub-chunk indicates |
397 |
close of an element. Any other non-empty chunk consists of plain |
|
44799 | 398 |
text. For example, see \verb|~~/src/Pure/PIDE/yxml.ML| or |
399 |
\verb|~~/src/Pure/PIDE/yxml.scala|. |
|
28224 | 400 |
|
401 |
YXML documents may be detected quickly by checking that the first |
|
40406 | 402 |
two characters are \isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E626F6C643E}{}\isactrlbold X\isaliteral{5C3C5E626F6C643E}{}\isactrlbold Y{\isaliteral{22}{\isachardoublequote}}}.% |
28224 | 403 |
\end{isamarkuptext}% |
404 |
\isamarkuptrue% |
|
405 |
% |
|
406 |
\isadelimtheory |
|
407 |
% |
|
408 |
\endisadelimtheory |
|
409 |
% |
|
410 |
\isatagtheory |
|
411 |
\isacommand{end}\isamarkupfalse% |
|
412 |
% |
|
413 |
\endisatagtheory |
|
414 |
{\isafoldtheory}% |
|
415 |
% |
|
416 |
\isadelimtheory |
|
417 |
% |
|
418 |
\endisadelimtheory |
|
419 |
\end{isabellebody}% |
|
420 |
%%% Local Variables: |
|
421 |
%%% mode: latex |
|
422 |
%%% TeX-master: "root" |
|
423 |
%%% End: |