Input-Data-Structure.html 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
  2. <html>
  3. <!-- Created on December 10, 2012 by texi2html 1.82
  4. texi2html was written by:
  5. Lionel Cons <[email protected]> (original author)
  6. Karl Berry <[email protected]>
  7. Olaf Bachmann <[email protected]>
  8. and many others.
  9. Maintained by: Many creative people.
  10. Send bugs and suggestions to <[email protected]>
  11. -->
  12. <head>
  13. <title>avram - a virtual machine code interpreter: 2.6.1 Input Data Structure</title>
  14. <meta name="description" content="avram - a virtual machine code interpreter: 2.6.1 Input Data Structure">
  15. <meta name="keywords" content="avram - a virtual machine code interpreter: 2.6.1 Input Data Structure">
  16. <meta name="resource-type" content="document">
  17. <meta name="distribution" content="global">
  18. <meta name="Generator" content="texi2html 1.82">
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <style type="text/css">
  21. <!--
  22. a.summary-letter {text-decoration: none}
  23. blockquote.smallquotation {font-size: smaller}
  24. pre.display {font-family: serif}
  25. pre.format {font-family: serif}
  26. pre.menu-comment {font-family: serif}
  27. pre.menu-preformatted {font-family: serif}
  28. pre.smalldisplay {font-family: serif; font-size: smaller}
  29. pre.smallexample {font-size: smaller}
  30. pre.smallformat {font-family: serif; font-size: smaller}
  31. pre.smalllisp {font-size: smaller}
  32. span.roman {font-family:serif; font-weight:normal;}
  33. span.sansserif {font-family:sans-serif; font-weight:normal;}
  34. ul.toc {list-style: none}
  35. -->
  36. </style>
  37. </head>
  38. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  39. <a name="Input-Data-Structure"></a>
  40. <table cellpadding="1" cellspacing="1" border="0">
  41. <tr><td valign="middle" align="left">[<a href="Parameter-Mode-Interface.html#Parameter-Mode-Interface" title="Previous section in reading order"> &lt; </a>]</td>
  42. <td valign="middle" align="left">[<a href="Input-for-Mapped-Applications.html#Input-for-Mapped-Applications" title="Next section in reading order"> &gt; </a>]</td>
  43. <td valign="middle" align="left"> &nbsp; </td>
  44. <td valign="middle" align="left">[<a href="Virtual-Machine-Specification.html#Virtual-Machine-Specification" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
  45. <td valign="middle" align="left">[<a href="Parameter-Mode-Interface.html#Parameter-Mode-Interface" title="Up section"> Up </a>]</td>
  46. <td valign="middle" align="left">[<a href="Library-Reference.html#Library-Reference" title="Next chapter"> &gt;&gt; </a>]</td>
  47. <td valign="middle" align="left"> &nbsp; </td>
  48. <td valign="middle" align="left"> &nbsp; </td>
  49. <td valign="middle" align="left"> &nbsp; </td>
  50. <td valign="middle" align="left"> &nbsp; </td>
  51. <td valign="middle" align="left">[<a href="avram.html#Top" title="Cover (top) of document">Top</a>]</td>
  52. <td valign="middle" align="left">[<a href="avram_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
  53. <td valign="middle" align="left">[<a href="Function-Index.html#Function-Index" title="Index">Index</a>]</td>
  54. <td valign="middle" align="left">[<a href="avram_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
  55. </tr></table>
  56. <hr size="1">
  57. <a name="Input-Data-Structure-1"></a>
  58. <h3 class="subsection">2.6.1 Input Data Structure</h3>
  59. <p>The data structure that is used as the argument to the parameter mode
  60. application incorporates all the information about the command line and
  61. <a name="index-environment-4"></a>
  62. <a name="index-command-line-1"></a>
  63. the environment variables. It is in the form of a triple
  64. <code>((<var>files</var>,<var>options</var>),<var>environs</var>)</code>. The fields have
  65. these interpretations.
  66. </p>
  67. <dl compact="compact">
  68. <dt> <var>files</var></dt>
  69. <dd><p>is a list of quadruples
  70. <code>((<var>date</var>,<var>path</var>),(<var>preamble</var>,<var>contents</var>))</code>, with
  71. one quadruple for each input file named on the command line (but not the
  72. virtual code file or the <code>avram</code> executable). The list will be in
  73. the same order as the filenames on the command line, and is not affected
  74. by options interspersed with them. The fields in each item have the
  75. following interpretations.
  76. </p>
  77. <dl compact="compact">
  78. <dt> <var>date</var></dt>
  79. <dd><p>is the time stamp of the file in as a character string in the usual
  80. <a name="index-time-stamp"></a>
  81. <a name="index-date"></a>
  82. <a name="index-system-time"></a>
  83. <a name="index-current-time"></a>
  84. <a name="index-Unix-5"></a>
  85. Unix format, for example, <code>Fri Jan 19 14:34:44 GMT 2001</code>. If the
  86. file corresponds to standard input, the current system time and date are
  87. used.
  88. </p></dd>
  89. <dt> <var>path</var></dt>
  90. <dd><p>is the full path of the file, expressed as a list of strings. If the
  91. <a name="index-file-names-1"></a>
  92. <a name="index-paths-3"></a>
  93. <a name="index-absolute-path"></a>
  94. <a name="index-relative-path"></a>
  95. file corresponds to standard input, the list is empty. Otherwise, the
  96. first string in the list is the file name. The next is the name of the
  97. file&rsquo;s parent directory, if any. The next is the parent of the parent,
  98. and so on. The root directory is indicated by the empty string, so that
  99. any path ending with the empty string is an absolute path, while any path
  100. ending with a non-empty string is relative to the current working
  101. directory. Path separators (i.e., slashes) are omitted.
  102. </p></dd>
  103. <dt> <var>preamble</var></dt>
  104. <dd><p>In the case of a text file, or any file not conforming to the format in
  105. <a name="index-preamble-3"></a>
  106. <a href="File-Format.html#File-Format">File Format</a>, this field is <code>nil</code>. Otherwise, this field contains
  107. the preamble of the file expressed as a list of strings, or contains
  108. just the empty string if the file has no preamble. Any leading hashes in
  109. the preamble of the file are stripped.
  110. </p></dd>
  111. <dt> <var>contents</var></dt>
  112. <dd><p>In the case of a text file (as indicated by the <var>preamble</var> field), this
  113. <a name="index-text-files-2"></a>
  114. field will contain a list of character strings, with each line of the file
  115. contained in a character string. Otherwise, it can contain data in any
  116. format, which are obtained by converting the data section of the file
  117. to a tree.
  118. </p></dd>
  119. </dl>
  120. </dd>
  121. <dt> <var>options</var></dt>
  122. <dd><p>is a list of quadruples of the form
  123. <code>((<var>position</var>,<var>longform</var>),(<var>keyword</var>,<var>params</var>))</code>
  124. with one quadruple for each option appearing on the command line after
  125. the name of the virtual code file.
  126. </p>
  127. <dl compact="compact">
  128. <dt> <var>position</var></dt>
  129. <dd><p>is a natural number indicating the position of the option on the command
  130. <a name="index-naturals-1"></a>
  131. <a name="index-command-line-2"></a>
  132. line. The position numbers of all the options will form an ascending
  133. sequence, but not necessarily consecutive nor starting with zero. The
  134. missing numbers in the sequence will correspond to the positions of the
  135. file names on the command line, allowing their positions to be inferred by
  136. applications for which the position matters.
  137. </p></dd>
  138. <dt> <var>longform</var></dt>
  139. <dd><p>is a boolean value which is true if the option starts with two or more
  140. <a name="index-booleans-1"></a>
  141. dashes but false otherwise.
  142. </p></dd>
  143. <dt> <var>keyword</var></dt>
  144. <dd><p>is the key word of the option expressed as a character string. For example
  145. in the case of a command line option <kbd>--foo=bar,baz</kbd>, the keyword is
  146. <code>foo</code>. Leading dashes are stripped.
  147. </p></dd>
  148. <dt> <var>params</var></dt>
  149. <dd><p>is a list of character strings identifying the parameters for the
  150. command line option in question. In the case of an option of the form
  151. <kbd>--foo=bar,baz</kbd>, the first character string in the list will be
  152. <code>bar</code> and the next will be <code>baz</code>. The same applies if the
  153. option is written <kbd>--foo bar,baz</kbd> or <kbd>--foo =bar,baz</kbd>. If there
  154. are no parameters associated with the option, the list is empty.
  155. </p></dd>
  156. </dl>
  157. </dd>
  158. <dt> <var>environs</var></dt>
  159. <dd><p>is a list of pairs of character strings, with one pair in the list for
  160. <a name="index-environment-5"></a>
  161. each environment variable. The identifier is the left string in the
  162. pair, and the value is the right. For example, if the environment
  163. contains the definition <code>OSTYPE=linux-gnu</code>, there will be a pair in
  164. the list whose left side is the string <code>OSTYPE</code> and whose
  165. right side is the string <code>linux-gnu</code>.
  166. </p></dd>
  167. </dl>
  168. <hr size="1">
  169. <table cellpadding="1" cellspacing="1" border="0">
  170. <tr><td valign="middle" align="left">[<a href="Parameter-Mode-Interface.html#Parameter-Mode-Interface" title="Previous section in reading order"> &lt; </a>]</td>
  171. <td valign="middle" align="left">[<a href="Input-for-Mapped-Applications.html#Input-for-Mapped-Applications" title="Next section in reading order"> &gt; </a>]</td>
  172. <td valign="middle" align="left"> &nbsp; </td>
  173. <td valign="middle" align="left">[<a href="Virtual-Machine-Specification.html#Virtual-Machine-Specification" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
  174. <td valign="middle" align="left">[<a href="Parameter-Mode-Interface.html#Parameter-Mode-Interface" title="Up section"> Up </a>]</td>
  175. <td valign="middle" align="left">[<a href="Library-Reference.html#Library-Reference" title="Next chapter"> &gt;&gt; </a>]</td>
  176. <td valign="middle" align="left"> &nbsp; </td>
  177. <td valign="middle" align="left"> &nbsp; </td>
  178. <td valign="middle" align="left"> &nbsp; </td>
  179. <td valign="middle" align="left"> &nbsp; </td>
  180. <td valign="middle" align="left">[<a href="avram.html#Top" title="Cover (top) of document">Top</a>]</td>
  181. <td valign="middle" align="left">[<a href="avram_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
  182. <td valign="middle" align="left">[<a href="Function-Index.html#Function-Index" title="Index">Index</a>]</td>
  183. <td valign="middle" align="left">[<a href="avram_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
  184. </tr></table>
  185. <p>
  186. <font size="-1">
  187. This document was generated on <i>December 10, 2012</i> using <a href="http://www.nongnu.org/texi2html/"><i>texi2html 1.82</i></a>.
  188. </font>
  189. <br>
  190. </p>
  191. </body>
  192. </html>