From: Eric S. Raymond Date: Tue, 27 Jan 2004 07:37:27 +0000 (+0000) Subject: Added scope diagrams. X-Git-Tag: 1.0~165 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=7cf85ae03cf47306be8810243a6bc37e1dc1843b;p=mad.git Added scope diagrams. --- diff --git a/doc/mad-manual.xml b/doc/mad-manual.xml index bc035e7..5096b11 100644 --- a/doc/mad-manual.xml +++ b/doc/mad-manual.xml @@ -6,6 +6,11 @@ + + + + + ]> @@ -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: + + THROUGH END, FOR J = 2, .GE. K ... @@ -1617,21 +1624,31 @@ themselves, be iteration statements. However, if iteration statement a, then the scope of b must be entirely within the scope of a. The following diagrams represent some valid configurations: - + + +&scope1; + Here, although the scopes of a and b both end on statement K, iteration b is incremented and tested first. Therefore, iteration b is completed before iteration a is incremented: + +&scope2; The following diagram represents an invalid configuration: - + +&scope3; + + 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: +&scope4; + In example (5), iteration a has a nesting depth 0, iteration b has nesting depth 1, and iteration c has nesting depth 2. In example (3), @@ -1642,6 +1659,8 @@ depths of 1. statements in the scope of an iteration. + + Pause Statement @@ -1662,7 +1681,7 @@ at which the stop occurred. Normally, the value of a function will occur as part of an expression, as in the statement: - programlisting>Z = COS.(X)/SIN.(X + 2.) +Z = COS.(X)/SIN.(X + 2.) Certain functions, however, may stand alone as separate @@ -1701,8 +1720,9 @@ statement is executed. 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. +will cause control to be transferred to the +operating system in which the translated program is imbedded, with an +error indication. End of program Statement @@ -1743,14 +1763,6 @@ ENTRY TO ℳ where ℳ is the name of this entry (see section 3.8). - - - - - - - -