1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 98.1p1 release (March 2nd, 1998)
originally by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Structure File Encoding</TITLE>
<META NAME="description" CONTENT="Structure File Encoding">
<META NAME="keywords" CONTENT="tpman">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<LINK REL="STYLESHEET" HREF="tpman.css">
<LINK REL="next" HREF="node43.html">
<LINK REL="previous" HREF="node41.html">
<LINK REL="up" HREF="tpman.html">
<LINK REL="next" HREF="node43.html">
</HEAD>
<BODY >
<!--Navigation Panel-->
<A NAME="tex2html642"
HREF="node43.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="/usr/share/latex2html/icons/next.png"></A>
<A NAME="tex2html638"
HREF="tpman.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="/usr/share/latex2html/icons/up.png"></A>
<A NAME="tex2html632"
HREF="node41.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="/usr/share/latex2html/icons/prev.png"></A>
<A NAME="tex2html640"
HREF="node4.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="/usr/share/latex2html/icons/contents.png"></A>
<A NAME="tex2html641"
HREF="node58.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
SRC="/usr/share/latex2html/icons/index.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html643"
HREF="node43.html">Compatibility with previous versions</A>
<B> Up:</B> <A NAME="tex2html639"
HREF="tpman.html">The Term Processor Kimwitu</A>
<B> Previous:</B> <A NAME="tex2html633"
HREF="node41.html">Syntax of the Kimwitu</A>
<BR>
<BR>
<!--End of Navigation Panel-->
<H1><A NAME="SECTION000130000000000000000">
Structure File Encoding</A>
</H1>
This is a description of the ASCII SSL V3 format as used by Grammatech's Synthesizer
Generator and the term processor Kimwitu (University of Twente).
(Actually, both of these are generators of programs using this representation.)
<P>
Not all features are described, e.g. other atomic phyla are possible in Synthesizers, but not
in combination with Kimwitu.
<P>
The structure file format is an ASCII encoding of a term.
It is a prefix representation of this term.
A file representation has two major components.
The first component is a table of the operators that are used in the term,
operators not appearing in the term do not have to be contained in this table.
The operators in this table are numbered, starting from 0.
The second component of the file is a representation of the term (or object as it is called).
The begin markers of these components, <I>$operators</I> and <I>$object</I>,
must be followed by one space at the end of the line.
<P>
Each line in the operator table describes the properties of one operator, and has 4 fields.
The fields in the line are separated by one space.
They are: the operator name, the number of its operands, the number of attributes (in term processor
generated files this is always 0), and an indication of whether the operator belongs to an atomic phylum
(1=yes, 0=no).
<P>
In the object section each line
represents one node in the term.
There are four types of these nodes: operator applications, string constants, integer constants,
and pointers to shared nodes.
<P>
A line beginning with a number denotes an operator application, it is an index in the operator table.
The rest of this line, if any, can be ignored (it contains an alternative unparsing indication
for some tools).
An operator of an atomic phylum is followed, on the next line, by a representation of a value.
<P>
A plus sign (+) denotes a string, and is followed by a number indicating the number of characters in
the string, a separating space, and the string.
In the string, all printable characters except the backslash (
<!-- MATH: $\backslash$ -->
<IMG
WIDTH="11" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"
SRC="img42.gif"
ALT="$\backslash$">)
are represented as such.
A backslash is doubled, and a non printable character is represented as a backslash followed
by a hexadecimal representation of the ascii number, e.g. newline is
<!-- MATH: $\backslash$ -->
<IMG
WIDTH="11" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"
SRC="img42.gif"
ALT="$\backslash$"><TT>oa</TT>.
An integer is represented as the string encoding of its decimal representation.
<P>
Pointers serve to share trees, and strings (but not integers).
Such a pointer is encoded in a base-64 representation, in which the character <TT>:</TT>
represents the `digit' 0, and the character <TT>y</TT> represents the `digit' 63.
Intermediate `digits' are represented by the intermediate ascii characters.
For example, the string <TT>;=</TT> denotes the value 67.
Conceptually at least, the result of each operator application is stored in one table,
and each string
is stored in a second table.
The two numbers on the line below the begin marker <I>$object</I> give the size of the
operator application resp. the string table.
The pointer value is then a reverse index (counting from the end back)
in the appropriate table of values.
E.g. the last value of the appropriate kind in the file before the pointer has number 1.
<P>
The following two examples illustrates the structure file format.
Both examples show the same term; the first example contains no sharing,
the second everything possible is shared.
Also, in the second example the operator table in the operators section has been
sorted (decreasingly) on the number of operator applications.
As a result, the references to this table should be smaller (lower numbers), taking less
characters for their representation.
<P><TABLE CELLPADDING=3>
<TR><TD ALIGN="LEFT">A#S#C#S#S#L#V#3
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>magic word indicating file type</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">$operators
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>begin marker operator table</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Spec 12 0 0
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>operator 0</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Label 1 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">_Str 0 0 1
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>operator of an atomic phylum</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">Nilcr_comment_list 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Specification_id 1 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Identifier 2 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">NoCaseStr 0 0 1</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_DefExtension 1 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">Nilcr_gate_identifier_list 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">Nilcr_identifier_declaration_list 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Noexit_part 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">Nilcr_data_type_definition_list 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Definition_block 3 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Stop_expression 2 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">Nilcr_annotation_list 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">Nilcr_process_definition_list 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Booleans_NotChecked 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_IS8807 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">$object
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>begin marker object</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">24 4
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>number of operator applications; number of strings</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">0
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>operator application, index in table above</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">1</TD>
</TR>
<TR><TD ALIGN="LEFT">2</TD>
</TR>
<TR><TD ALIGN="LEFT">+10 specname_1
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>string representation</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">3</TD>
</TR>
<TR><TD ALIGN="LEFT">4</TD>
</TR>
<TR><TD ALIGN="LEFT">5</TD>
</TR>
<TR><TD ALIGN="LEFT">6</TD>
</TR>
<TR><TD ALIGN="LEFT">+8 specname</TD>
</TR>
<TR><TD ALIGN="LEFT">7</TD>
</TR>
<TR><TD ALIGN="LEFT">6</TD>
</TR>
<TR><TD ALIGN="LEFT">+1 0</TD>
</TR>
<TR><TD ALIGN="LEFT">8</TD>
</TR>
<TR><TD ALIGN="LEFT">9</TD>
</TR>
<TR><TD ALIGN="LEFT">10</TD>
</TR>
<TR><TD ALIGN="LEFT">11</TD>
</TR>
<TR><TD ALIGN="LEFT">3</TD>
</TR>
<TR><TD ALIGN="LEFT">12</TD>
</TR>
<TR><TD ALIGN="LEFT">13</TD>
</TR>
<TR><TD ALIGN="LEFT">1</TD>
</TR>
<TR><TD ALIGN="LEFT">2</TD>
</TR>
<TR><TD ALIGN="LEFT">+6 stop_0</TD>
</TR>
<TR><TD ALIGN="LEFT">14</TD>
</TR>
<TR><TD ALIGN="LEFT">11</TD>
</TR>
<TR><TD ALIGN="LEFT">15</TD>
</TR>
<TR><TD ALIGN="LEFT">16</TD>
</TR>
<TR><TD ALIGN="LEFT">14</TD>
</TR>
<TR><TD ALIGN="LEFT">17</TD>
</TR>
</TABLE>
<P><TABLE CELLPADDING=3>
<TR><TD ALIGN="LEFT">A#S#C#S#S#L#V#3
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>magic word indicating file type</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">$operators
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>begin marker operator table</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Label 1 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">NoCaseStr 0 0 1
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>operator of an atomic phylum</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">_Str 0 0 1
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>operator of an atomic phylum</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">Nilcr_identifier_declaration_list 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Spec 12 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_IS8807 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">Nilcr_comment_list 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Booleans_NotChecked 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_DefExtension 1 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Specification_id 1 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Definition_block 3 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">Nilcr_process_definition_list 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Identifier 2 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">Nilcr_gate_identifier_list 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">Nilcr_annotation_list 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Noexit_part 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">Nilcr_data_type_definition_list 0 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">CR_Stop_expression 2 0 0</TD>
</TR>
<TR><TD ALIGN="LEFT">$object
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>begin marker object</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">21 4
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>number of operator applications; number of strings</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">4
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>operator application, index in table above</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">0</TD>
</TR>
<TR><TD ALIGN="LEFT">2</TD>
</TR>
<TR><TD ALIGN="LEFT">+10 specname_1
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>string representation</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">6
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>shared node referenced below as label_1</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">9</TD>
</TR>
<TR><TD ALIGN="LEFT">12</TD>
</TR>
<TR><TD ALIGN="LEFT">1</TD>
</TR>
<TR><TD ALIGN="LEFT">+8 specname</TD>
</TR>
<TR><TD ALIGN="LEFT">8</TD>
</TR>
<TR><TD ALIGN="LEFT">1</TD>
</TR>
<TR><TD ALIGN="LEFT">+1 0</TD>
</TR>
<TR><TD ALIGN="LEFT">13</TD>
</TR>
<TR><TD ALIGN="LEFT">3</TD>
</TR>
<TR><TD ALIGN="LEFT">15</TD>
</TR>
<TR><TD ALIGN="LEFT">16
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>shared node referenced below as label_2</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">D
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>reference to label_1 above</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">10</TD>
</TR>
<TR><TD ALIGN="LEFT">17</TD>
</TR>
<TR><TD ALIGN="LEFT">0</TD>
</TR>
<TR><TD ALIGN="LEFT">2</TD>
</TR>
<TR><TD ALIGN="LEFT">+6 stop_0</TD>
</TR>
<TR><TD ALIGN="LEFT">14
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>shared node referenced below as label_3</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">@
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>reference to label_2 above</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">11</TD>
</TR>
<TR><TD ALIGN="LEFT">7</TD>
</TR>
<TR><TD ALIGN="LEFT">=
<!-- MATH: $\leftarrow$ -->
<IMG
WIDTH="19" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img43.gif"
ALT="$\leftarrow$">
<EM>reference to label_3 above</EM></TD>
</TR>
<TR><TD ALIGN="LEFT">5</TD>
</TR>
</TABLE>
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html642"
HREF="node43.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="/usr/share/latex2html/icons/next.png"></A>
<A NAME="tex2html638"
HREF="tpman.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="/usr/share/latex2html/icons/up.png"></A>
<A NAME="tex2html632"
HREF="node41.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="/usr/share/latex2html/icons/prev.png"></A>
<A NAME="tex2html640"
HREF="node4.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="/usr/share/latex2html/icons/contents.png"></A>
<A NAME="tex2html641"
HREF="node58.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
SRC="/usr/share/latex2html/icons/index.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html643"
HREF="node43.html">Compatibility with previous versions</A>
<B> Up:</B> <A NAME="tex2html639"
HREF="tpman.html">The Term Processor Kimwitu</A>
<B> Previous:</B> <A NAME="tex2html633"
HREF="node41.html">Syntax of the Kimwitu</A>
<!--End of Navigation Panel-->
<ADDRESS>
<I></I>
<BR><I>2000-04-17</I>
</ADDRESS>
</BODY>
</HTML>
|