The text read off it
[page 7]
schematically in Figure 4, which emphasizes that both parts of the conditional clause must be true before carrying out the action specified after THEN. If either (or both) of the parts is false, the action specified after OTHERWISE is executed; if OTHERWISE is absent the program continues with the succeeding sentence.
In the Commercial Translator sentence under consideration, the actions specified after both THEN and OTHERWISE happen to be a new command, GO TO. The GO TO command makes it possible to get out of the one-after-the-other sequential execution of sentences and sections and instead execute next the sentence named by the GO TO.
Figure 4. Schematic structure of an IF...AND...THEN...OTHERWISE sentence (page 7).
Construction of the Commercial Translator Language
These examples are intended to introduce some of the important ideas of the Commercial Translator language with a minimum of formality, and without attempting to be complete. It may be, however, that the reader will find the remaining examples more meaningful if we pause here to generalize about some of the concepts which have been illustrated.
It may be helpful to think of the Commercial Translator language as existing on two different levels. At the first level, we are concerned with the elements of the language: characters, fixed words, punctuation, names, literals, etc. In short, we wish to define precisely the constituent elements of the language. This is done in Chapter 2.
The second level of the language, which may be called the syntax of the Commercial Translator language, has to do with how to fit elements together properly, in such a way as to describe the desired procedure. Here we are concerned with the rules for grouping words, provisions for joining expressions, techniques for program organization, etc. These are covered in detail in Chapters 2 and 3.
For instance, one basic structural building block is an expression; this is defined as any grouping of elements which always establishes a unique value. An arithmetic expression can take on any numeric value whereas a conditional expression may only be true or false. A true expression is sometimes converted to the value 1 and a false expression to the value 0.
Another concept in the language structure is that of a clause. A clause consists of a fixed word or words, together with an associated format or framework into which the programmer inserts names and expressions. We may distinguish two types of clauses: imperative clauses, i.e., commands, and conditional clauses.
We have seen examples of commands in SET and MOVE operations. We saw that in each case there was associated with the command a format: SET a name = an expression, and MOVE a name TO a name. Commands are independent clauses which may stand alone. When the source program is converted to the object program, commands are converted directly into corresponding machine instructions in the object program.