]> thyrsus.com Git - mad.git/commitdiff
Added scope diagrams.
authorEric S. Raymond <esr@thyrsus,com>
Tue, 27 Jan 2004 07:37:27 +0000 (07:37 +0000)
committerEric S. Raymond <esr@thyrsus,com>
Tue, 27 Jan 2004 07:37:27 +0000 (07:37 +0000)
doc/mad-manual.xml

index bc035e70197fb1c94e3517414b654eca186fcfd6..5096b11665fe1a123cd7bcf5fc75eabf69804cb9 100644 (file)
@@ -6,6 +6,11 @@
 <!ENTITY maxfunc SYSTEM "../madhouse/maxfunc.mad">
 <!ENTITY newton1 SYSTEM "../madhouse/newton1.mad">
 <!ENTITY newton2 SYSTEM "../madhouse/newton2.mad">
+<!ENTITY scope1 SYSTEM "scope1.xml">
+<!ENTITY scope2 SYSTEM "scope2.xml">
+<!ENTITY scope3 SYSTEM "scope3.xml">
+<!ENTITY scope4 SYSTEM "scope4.xml">
+
 <!ENTITY statement "&sgr;">
 ]>
 <book>
@@ -1573,6 +1578,8 @@ iteration is to be performed for those multiples of 2 which are not
 multiples of 5 and which are less than the value of the integer K, one
 might write the iteration as follows:</para>
 
+<!-- beginpage -->
+
 <programlisting>
        THROUGH END, FOR J = 2, .GE. K
        ...
@@ -1617,21 +1624,31 @@ themselves, be iteration statements.  However, if iteration statement
 <emphasis>a</emphasis>, then the scope of <emphasis>b</emphasis> must
 be entirely within the scope of <emphasis>a</emphasis>.  The following
 diagrams represent some valid configurations:</para>
-       
+
+<!-- beginpage -->
+&scope1;
+
 <para>Here, although the scopes of <emphasis>a</emphasis> and
 <emphasis>b</emphasis> both end on statement K, iteration
 <emphasis>b</emphasis> is incremented and tested first.  Therefore,
 iteration <emphasis>b</emphasis> is completed before iteration
 <emphasis>a</emphasis> is incremented:</para>
+
+&scope2;
        
 <para>The following diagram represents an invalid configuration:</para>
-       
+
+&scope3;
+
+<!-- beginpage -->
 <para>When iteration statements occur in the scope of other iteration
 statements, they are said to be "nested".  The "nesting depth" of an
 iteration statement is the number of iteration statements in whose
 scope it appears.  The nesting depth of an iteration may not exceed
 50.  For example:</para>
 
+&scope4;
+
 <para>In example (5), iteration <emphasis>a</emphasis> has a nesting
 depth 0, iteration <emphasis>b</emphasis> has nesting depth 1, and
 iteration <emphasis>c</emphasis> has nesting depth 2.  In example (3),
@@ -1642,6 +1659,8 @@ depths of 1.</para>
 statements in the scope of an iteration.</para>
 
 </sect2>
+
+<!-- beginpage -->
 <sect2><title>Pause Statement</title>
 
 <programlisting>
@@ -1662,7 +1681,7 @@ at which the stop occurred.</para>
 <para>Normally, the value of a function will occur as part of an expression, as in the statement:</para>
 
 <programlisting>       
-       programlisting>Z = COS.(X)/SIN.(X + 2.)
+Z = COS.(X)/SIN.(X + 2.)
 </programlisting>
        
 <para>Certain functions, however, may stand alone as separate
@@ -1701,8 +1720,9 @@ statement is executed.</para>
 <para>Even though an error return has been provided in the definition
 of a function, in the use of the function the last argument may be
 omitted.  If it is omitted, execution of the ERROR RETURN statement
-will cause control to be transferred to the operating system in which
-the translated program is imbedded, with an error indication.</para>
+will cause control <!-- beginpage --> to be transferred to the
+operating system in which the translated program is imbedded, with an
+error indication.</para>
 
 </sect2>
 <sect2><title>End of program Statement</title>
@@ -1743,14 +1763,6 @@ ENTRY TO &phmmat;
 <para>where &phmmat; is the name of this entry (see section 3.8).</para>
 </sect2>
 
-
-       
-       
-       
-       
-
- 
-
 </sect1>
 </chapter>
 </book>