Tj£6A/ UIUCDCS-R-75-685 AN INTERACTIVE COBOL SYSTEM FOR PLATO by Robert D. Barnett January, 19 75 The Ubrarv JAN1 1975 £ t Urb3n3-Cham. DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN URBANA, ILLINOIS UIUCDCS-R-7 5-685 AN INTERACTIVE COBOL SYSTEM FOR PLATO by Robert D. Barnett January, 19 75 Department of Computer Science University of Illinois at Urbana-Champaign Urbana, Illinois 61801 Submitted in partial fulfillment of the requirements for the degree of Master of Science in Computer Science, January, 19 75 Digitized by the Internet Archive in 2013 http://archive.org/details/interactivecobol685barn TJUer UO'1. V ACKNOWLEDGMENT The author would like to express appreciation to Dr. Thomas R. Wilcox for introducing the author to the ACSES project and for his guidance in the preparation of this thesis, and to Dr. Jurg Nievergelt for his advice and encouragement. Appreciation is also expressed to the other members of the compiler group, Mike Tindall, Al Davis and Mike Milner, for their advice and cooperation. The ACSES project in PLATO is supported by grant NSF-EC-41511 of the National Science Foundation. The author has been supported in part by Veterans' Bill benefits IV TABLE OF CONTENTS Chapter Page 1 INTRODUCTION 1 1.1 The PLATO system . 1 1.2 General structure 2 2 THE COBOL SUBSET 4 3 THE PROGRAM EDITOR 7 3.1 As seen by the student 7 3.2 The tables of the compiler-writing system 7 3.3 Internal character codes .... 8 3.4 Columnar format and tab settings . 9 3.5 Lexical tables 10 3.6 Key function tables 17 3.7 Predefined symbols 17 3.8 Syntax description 19 4 THE EXECUTION INTERPRETER 21 4.1 Primary data structures .... 22 4.2 The supervisor 24 4.2.1 Interaction with the student. 24 4.2.2 Expression evaluation ... 26 4.2.3 The PERFORM statement ... 27 4.2.4 The GO TO statement ... 28 4.2.5 Other statements .... 29 4.2.6 Unit "address" 29 4.3 The machine 31 4.3.1 Binary mode 34 4.3.2 Decimal mode 36 4.3.3 Character mode 36 5 DOCUMENTATION PROVISIONS 3 7 6 CONCLUSIONS 40 LIST OF REFERENCES 42 V Page APPENDIX A COBOL HELP LESSON 44 B COBOL TABLES IN THE COMPILER-WRITING SYSTEM . 65 B.l Primary tables 66 B.l.l Internal character codes ... 67 B.1.2 Initial tab settings 68 B.l. 3 Key function tables 69 B.l. 4 Lexical character classes ... 77 B.1.5 Lexical node table 78 B.l. 6 Safe nodes 83 B.l. 7 Predefined symbols 84 B.l. 8 Field tokens 91 B.l. 9 New symbol allocation classes. . 92 B.2 Picture tables 93 B.2.1 Lexical character classes ... 94 B.2. 2 Lexical node table 95 B.2. 3 Safe nodes 99 C OTHER DOCUMENTATION 100 C.l Transition diagram sample 101 C.2 Flowchart of "cobolrun" 104 C.3 Mode table diagram 12 8 D SAMPLE COBOL PROGRAM 129 E PROGRAM LISTINGS 136 1. INTRODUCTION A project to provide automated instruction in computer science, ACSES (Automatic Computer Science Education System) [8] , is in progress at the University of Illinois at Urbana-Champaign using the PLATO computer-based education system. An important part of ACSES is a set of interactive compilers which allow students learning one of several pro- gramming languages to write and execute small programs through their PLATO terminal. This thesis describes the design and implementation of the COBOL compiler system in ACSES. 1.1 The PLATO system PLATO is a computer-based education system which has evolved since 1959 [7] . The current system, PLATO IV, in- cludes a CDC CYBER 73 computer linked with over 700 terminals in more than 100 locations. A hierarchy of memories (fast core memory, extended core storage and disks) contain lesson material for a wide variety of academic areas. The PLATO IV student terminal has a keyboard input device that includes regular typewriter keys and special function keys. The ter- minal screen is an 8 1/2" square plasma display panel, pro- viding storage of information on the screen itself without flicker and without being constantly refreshed [9] . A powerful language, TUTOR, is used to write the instructional programs, called "lessons." 1.2 General structure The COBOL compiler system consists of three TUTOR lessons. The COBOL editor accepts the program entered by the student using the PLATO keyboard. The COBOL interpreter executes the student's COBOL program. A third lesson pro- vides information needed to successfully use the COBOL system, such as the subset of COBOL implemented. Since it is a part of ACSES , the COBOL system is designed for use by students beginning their study of COBOL. Therefore a primary goal has been to provide the student with good diagnostic messages, issued as soon as possible, both in the editor and the interpreter. The student can write a short COBOL program and execute it within a few minutes. Only a relatively small subset of COBOL has been in- plemented. This subset, described in chapter two, is designed to be adequate for beginning COBOL programmers. A key feature of the COBOL system is that it uses a table-driven compiler-writing system developed by Dr. Thomas Wilcox and Michael Tindall [13] . PL/I has already been imple- mented using this system, while FORTRAN IV and BASIC are cur- rently being developed. The use of this language-independent system greatly reduces the effort required to develop an editor for a specific language, since the language implementor only needs to add the specifics of a language to a skeleton editor. This consists primarily of specifying table entries and writing a description of the language's syntax. However, the COBOL interpreter, while using some parts of the compiler- writing system, is largely language-dependent. 2. THE COBOL SUBSET Full COBOL is an extensive programming language designed for data processing applications. To implement the entire COBOL language would greatly exceed the table sizes of the language-independent editor routines. However a relatively small subset of COBOL, given in Appendix A, is sufficient to satisfy the educational goals of ACSES with respect to COBOL. The overall criterion for selecting the subset has been to include all the features essential to writing elementary COBOL programs. The American National Standards Institute (ANSI) , formerly known as the United States of America Standards In- stitute (USASI) , is responsible for maintaining standards for COBOL. It has defined a minimum subset of COBOL which manu- facturers are expected to include in their COBOL compilers [10]. This minimum ANSI subset is comparable to the subset described here. However several features have been deleted and a few added, for reasons given in the following paragraphs. Any COBOL compiler must support the basic data pro- cessing requirements. These include reading and writing data organized in records and files, moving and comparing data, doing simple arithmetic calculations, and controlling the flow of program execution. The COBOL statements OPEN, READ, WRITE , CLOSE, MOVE, IF, ADD, SUBTRACT, MULTIPLY, DIVIDE, GO, PERFORM, EXIT and STOP form the minimum set that satisfies these requirements. All are included in the ANSI subset and all except DIVIDE are in the PLATO subset. Compactness is a desirable quality of computer pro- grams [11] which COBOL programs seldom achieve due to the requirements of COBOL syntax. In order to achieve some measure of compactness, the COMPUTE verb, not included in the ANSI subset, has been included in the PLATO subset. Without the COMPUTE verb a COBOL programmer must use several arithmetic statements and must define intermediate results in order to evaluate an arithmetic expression. The DIVIDE verb has been excluded, since it is infrequently used and COMPUTE includes its functions. Other extensions to the ANSI subset which improve the compactness and locality of COBOL are nested IF statements, some forms of compound conditions, and arithmetic expressions in conditions. Another influence in the definition of the COBOL sub- set was Armstrong [1] , who points out the problems with the ALTER verb and with complex conditions. ALTER often hides pro- gram structure by causing a GO to branch to a paragraph other than that named. Instead the DEPENDING ON option of the GO TO has been included. Beginning COBOL programmers often are confused by the rather complex rules governing precedence of logical operators and governing implied operators and subjects of relations. To prevent these problems, implied operators and subjects are not allowed, the logical connectives AND and OR may not be used in the same condition, and NOT is restricted to use as a part of a relation or class test. The language-independent editor routines are de- signed for programs not larger than 2 8 lines of 64 characters each (the space available on the PLATO screen) . Since COBOL requires many lines of code for even a trivial program, modifications to COBOL were required to reduce program sizes. The first two of COBOL* s four divisions, the IDENTIFICATION and ENVIRONMENT divisions, have been excluded, as well as the two headers usually beginning the DATA division. This is not a serious loss, since most of the excluded portions are fixed division and section headers which the student can easily learn elsewhere. The final criterion for inclusion in the PLATO subset was space availability. Each table in the editor has a maximum size; the subset implemented uses nearly the maximum number of predefined names and entries in the syntax code table. For this reason some lesser used features that are part of the ANSI standard subset could not be included, such as the EXAMINE verb and index data-items. 3. THE PROGRAM EDITOR 3.1 As seen by the student As the student types his program using the PLATO keyboard, it is displayed on the PLATO screen. At the same time, it is examined by the lexical, syntactic and semantic routines of the editor. Any errors detected are immediately called to the student's attention by drawing a rectangle around the character or word just entered. If the student then presses the HELP key, an error message is dis- played explaining the error or listing legal alternatives. If the student again presses HELP and the error is syntactic or semantic, a message giving the syntactic type of the last token entered is written. By using the special black keys of the PLATO key- board, the student can position the cursor at any point in his program, add or delete characters, and indicate when he has completed his program. 3.2 The tables of the compiler-writing system The editing features described in Section 3.1 are features of the compiler-writing system incorporated into the COBOL editor. A set of tables, developed and maintained by auxiliary programs, describes the internal character codes, key function tables, default keyboard tab stops, lexical class assignments, lexical node table, "safe" nodes, pre- defined symbols, field symbols, new symbol allocation classes and syntax tables. Details of each of these tables as used in the COBOL editor are given in the following sections. In addition to the tables , semantic routines and error messages are added to the editor by the language imple- mentor. Although initially developed for free format languages, the compiler-writing system has been modified to accomodate features of fixed format languages, such as the continuation of words between lines in COBOL. In general the system works well with COBOL, but there are problems with lexical analysis, discussed in Section 3.5. Semantic routines, written in TUTOR, must be used extensively, par- ticularly in parsing data structures and in examining pictures, to do verifications which are difficult or im- possible through the tables. 3.3 Internal character codes There are 63 characters available, as given in Appendix B.l.l. These are the normally printable characters from the EBCDIC character codes used in the IBM 360/370 and other computers. This set was chosen to avoid confusion for the students using PLATO who are also using the IBM computers available on campus and elsewhere. Although the bit con- figurations are different, the characters have the same ordering as in EBCDIC. In the character tables seven bits are available for each character. The extra seventh bit is used in the in- terpreter as a sign bit of a signed decimal field. If the high-order bit of the most significant digit position is on, the field is negative. There is a sixty-fourth character, made of three question marks, which the student cannot enter. At the be- ginning of execution the interpreter sets all character posi- tions to this value. Then the arithmetic routines check for it to determine whether a field has ever been assigned a value 3.4 Columnar format and tab settings Standard COBOL has a fixed column format based on an 80 column card, but the PLATO screen is only 64 characters wide. To make the most efficient use of the available space, those fields used for documentation only, usually columns one to six and 73 to 80, are not available. In the resulting format column one may contain a hyphen to indicate continu- ation, an asterisk to indicate a line of comments, or a blank. Columns two through five are area A, where division and 10 section headers, paragraph names and some level numbers must begin. Area B is columns six through 64. During editing tab stops appear near the top of the screen. The student may press TAB to have blanks inserted up to the next tab stop. The initial settings of the tab stops are in a table, but may be changed by the student. The first tab stop setting in COBOL is at column six, so that by pressing the TAB key at the start of a new line the student can quickly get to area B. Additional tab stops pro- vide for easy identification or organization of clauses in columns, as given in Appendix B.1.2. 3.5 Lexical tables The lexical tables include the lexical class assignment table, the lexical node table and the safe node list. Using these tables the language-independent editor per- forms the lexical analysis of the COBOL program, consisting of scanning the input and constructing the tokens of the lan- guage. COBOL tokens may be words, punctuation, arithmetic operators, relational operators and picture strings. The model for lexical analysis is a finite state machine. Lexical analysis of a particular token starts in state zero, alias node zero, then node transitions are made according to current node and character class of the next in- put, as established by the lexical class assignment table. The column on the screen in which the character appears is also assigned a character class so that lexical decisions may be 11 based on the screen location of a character. Table entries representing illegal inputs at a given node contain error message numbers. When a legal token is recognized, the table entry indicates whether the token is extendable (an extendable token is one whose termination is determined only by a delimeter not included in the token) . There are also pro- visions to generate field tokens indicating the presence of a token in a particular range of columns, to allow for tokens to be continued between lines and to call a subroutine of nodes. COBOL presented several problems in adopting it to use the lexical tables. Largest of these was that the lexical characteristics of picture strings are vastly different from that of all other COBOL tokens, requiring a far greater number of node table entries than are available in a single node table. Minor modifications were made to the editor which allow for a second set of lexical tables for picture strings which are loaded in place of the regular set when needed. Both sets of lexical tables are discussed in the following paragraphs. The first set of lexical tables is used for all tokens except picture strings. The lexical class assign- ments, given in Appendix B.1.4, partition the characters and columns into classes; all members of a class are equivalent in lexical analysis. The columns are partitioned 12 into three character classes: column one, two through five and six through 64 representing the continuation column, area A and area B, respectively. The characters P, I and C each belong to a character class consisting only of that character, so that PIC followed by a blank may be recognized lexically and used as described later. Safe nodes are those which can handle the start of a new line. If the lexical routines are not in a safe node when the student presses CR (carriage return) , blanks are inserted on the current line until a safe node is reached. In the COBOL tables the safe nodes, listed in Appendix B.1.6, include the initial node, the node for a string of blanks, the node for a comment line and all nodes representing tokens which may be continued on the next line. An example of the latter is node one; it represents a sequence of characters which forms a COBOL word. The word may be terminated by a delimeter or may be continued on the current line or in area B of the following line. The first lexical node table uses every feature available to it in the compiler-writing system. Most of the tokens recognized are COBOL words consisting of letters, digits and hyphens. They are always extendable tokens because they are terminated by a delimeter, and they may be continued on a second line. Numeric constants and character string constants may also be continued. A numeric constant is an extendable token. Although a character string constant is terminated 13 by a quote which is part of the token, it is treated as an extendable token in order to enforce the COBOL rule requiring a delimeter following it. A problem that became apparent during program test- ing was partially solved by modifying the lexical tables. It is not difficult to write a COBOL program which fits on the PLATO screen and could be successfully entered by the student if there were only more entries in the intermediate text. The source of the problem is COBOL 's verboseness and in particular its rule that blanks separate most tokens, so that about one- half of the intermediate text entries are tokens of one or more blanks. To alleviate this problem the required blank is included as part of the preceding token whenever possible. This can be reasonably accomplished only for tokens which must always be delimited by spaces; this includes the arithmetic operators: +, -, *, /; the relational operators: <, =, >; the parentheses and the period. The lexical node table entries for these tokens define two character nonextendable tokens including the special character and a blank. A serious problem is caused by the dual role of the period in COBOL as both the decimal point in numeric constants and as the punctuation terminating a sentence. A series of digits followed by a period and a blank is interpreted in COBOL as an integer followed by a punctuation symbol. The problem arises in the lexical node table if the characters scanned so far are one or more digits followed by a period. 14 It is necessary to inspect the next character to determine the role of the period. If the next character is a space, the period was punctuation; if it's a digit, the period was a decimal point. In the former case the lexical node table entry recognizes an extendable token consisting of an integer and a period. This peculiar token, logically two tokens, is assigned to a unique syntactic class. Some additional code is required throughout both the editor and interpreter for this class. An unresolved problem caused by the dual role of the period is that two violations of COBOL punctuation rules cannot be detected. The lexical node tables will accept a period illegally surrounded by blanks, and a word followed by a period followed by an integer without any required inter- vening blanks. Because the lexical node table has no informa- tion regarding the previous token, it has no way to tell the role of a period that begins a token and must assume that it "could be either punctuation or a decimal point, while only one of these can ever be legal at a given point. Continuation of words, character strings and numeric constants onto the following line is accomplished using a sub- routine within the lexical node table. This subroutine uses the continuation features to form an effective token from the parts on the two lines. It is quite satisfactory, completely complying with COBOL continuation rules. Two field tokens are generated by the regular node table. One indicates the presence of a word or number be- 15 ginning in area A (columns two through five) so that the syn- tax routines can verify that tokens are placed in the proper area. The second field token is generated if a token begins with the characters PIC and blank. This field token triggers the loading of the second set of lexical tables to scan the picture string which must follow. A field token is associated with an entry in the name table but the character string as- sociated with the name table entry is never printed, because the field token exists only as a means of passing information. In the other set of lexical tables, used to scan picture strings, the finite-state machine model was less than ideal but the compiler-writing system allowed enough flexibili- ty to successfully handle the picture strings. Picture strings in COBOL may be rather complicated. In order to perform editing of numeric values to be printed a picture string such as -$ ( 3) , $$9VB99 might be used. The explicit representation of picture strings included in Appendix E.l is quite long, requiring the entire node table (32 nodes and 20 character classes) to implement. As a result some legal picture strings, such as those using the symbols A, CR, DB , P and +, are not included in the subset. This size is a result of the inefficiency of the finite-state model when applied to picture strings. The many legal combinations of picture type (alphanumeric, numeric edited and numeric) , floating or replacement character (- $ * Z or none) , whether a decimal point has been seen yet, and 16 whether an S was present can only be represented by a different state (node in the table) for each combination. When a legal picture string has been recognized, the class of the picture is returned to the syntax routines. Bits are set within the class number to indicate the picture type, whether the picture describes a noninteger numeric item and whether the picture indicates that the item should be com- pletely blank when it has a zero value. However more information is needed from a picture string. In order to verify that the lengths of different records in the same file and of redefined items are equal the syntax routines must know the lengths specified by picture strings. a semantic routine reexamines the picture strings lexically, determining the lengths as well as other inform- ation needed later by the interpreter. An alternate approach to picture strings is to treat each character in the picture string as a token, putting the burden of the verification of the picture strings on the syntactic routines. However, there are several reasons why this was rejected: It would require a large number of statements in the syntax program causing an overflow of the syntax node table; it would use significantly more entries in the name table, in the symbol table and in the intermediate text; and it would reduce the efficiency of the interpreter because the characters of the picture string would no longer 17 necessarily be in consecutive character table locations (a fact used by the editing routines) . 3.6 Key function tables The key function table assigns an action to each possible student keypress. Usually the regular typewriter keys cause a character to be added to the program, while the black function keys invoke an editing operation such as erasing a word or backing up a line. The key function table in the regular set of lexical tables is shown in Appendix B.1.3 along with an explanation of the special function codes. A second key function table is in the set of lexical tables for picture strings and is iden- tical to the first table except for a few of the editing keys. Because the lexical routines of the compiler-writing system back up to the start of a token if the student presses any key that backs up the editor, and the token containing the picture string includes PIC which must be scanned by the reg- ular tables, the editing keys which cause the editor to back up are assigned the function of loading the regular tables. Then the regular tables are used to determine the actual edit- ing function to be performed. 3.7 Predefined symbols The editor handles the tokens of a language using a name table, symbol table, character table and hash table. 18 Each different character string recognized as a token by lexical analysis has an entry in the name table. More than one name may be linked to the same symbol table entry, such as COMPUTATIONAL and its abbreviation COMP in COBOL. Also one name table entry may be linked to several symbol table entries. This is used in COBOL for the name FILLER which may be used for different unreferenced parts of data structures . All COBOL symbols which have meaning without declaration by the programmer are included in the predefined portion of the symbol table. This includes keywords and optional words of the PLATO subset, arithmetic and relational operators, punctuation and field symbols. A few name table entries were not used by the PLATO subset. In the vacant entries are common COBOL keywords not included in the PLATO subset, so that an appropriate error message can be displayed if the student tries to use one of these words. The compiler-writing system includes a table to assign each symbol to a procedure block. This feature is designed for block structured languages such as PL/I, but since COBOL has no block structure this table is not used in the COBOL editor. 19 3.8 Syntax description The syntax of the COBOL subset is given in a syntax description language designed as part of the compiler-writing system. This language is translated by an auxiliary program into a table of 12-bit entries to be interpreted by the editor as the student enters his program. Features of this language include comparisons based on the token just entered, updating symbol table entries, recursive calls to procedures, specify- ing error message numbers, and calls to semantic routines. The COBOL subset syntax language program is included in Appendix E.2 with explanations of the functions of each procedure and many statements. Only a broad view of the structure of the syntax program is presented here. There is a sharp division in the syntax program corresponding to the two divisions of the COBOL subset, the DATA and PROCEDURE divisions. Except for the initial syntax program (that portion preceeding the first procedure) the syntax of the two divisions is totally separate. The DATA DIVISION portion consists largely of two procedures "fdproc" and "parsitem" . "Fdproc" includes the syntax of the clauses of the FD statement, and calls "parsitem" to parse the record descriptions of the FD . A particular invocation of "parsitem" examines all the items directly sub- ordinate to the same item in the data structure, calling it- self recursively for any further sub-items. 20 COBOL posed several problems in these two pro- cedures. Because the clauses of an FD or a data item descrip- tion may appear only once and in any order, it would have re- quired excessive space to have separate logic paths for each possibility. Instead at the start of the code for each clause a check of either a symbol table entry or a variable is made to insure that the clause has not already occurred in the current FD or data item description. Because many combinations of data item clauses are invalid there are many checks for il- legal combinations. Because computations are not available in the syntax language but are needed to determine the lengths and storage locations of files and data items, several calls to semantic routines written in TUTOR are used. More semantic routines are used to access variables and routines of the editor not otherwise available to the syntax program and to check types in relations and VALUE clauses. The syntax of the PROCEDURE DIVISION presented fewer problems. The primary procedure, "statelst", contains the basic syntax for each COBOL verb. It is called recursively to parse the list of statements which occur in the true and false branches of IF statements and in the AT END branch of the READ statement. There are procedures to parse conditions, relations and expressions, and to look for a particular oper- and type such as a numeric data item. Substantial type check- ing is required in MOVE statements and in relations. 21 4. THE EXECUTION INTERPRETER After the student has entered his program he goes to the COBOL interpreter lesson to execute his program. The interpreter acts on an intermediate text representation of the COBOL source program, essentially the program represented as a series of tokens. The interpreter carries out the in- structions in the PROCEDURE DIVISION by invoking appropriate TUTOR routines. The most difficult problem in designing the COBOL interpreter was the lack of commands in TUTOR to direct- ly handle binary coded decimal data. The CDC CYBER 73, and therefore also TUTOR, is organized around a 60 bit word containing a floating-point number, a fixed-point integer or 10 six bit characters. However in order to use charac- ters in computation they must first be converted into fixed- point or floating-point form. COBOL uses binary coded deci- mal fields extensively in input and output files, and allows the programmer to do arithmetic using these fields. The solution found to this problem was inspired by Wilcox's division of code generation into two phases, trans- lation and coding [12] . The interpreter is organized in two large parts, which will be called the "supervisor" and the "machine." The supervisor includes the translation of expres- sions to a postfix representation, the scanning of the 22 intermediate text, all interaction with the student user, and subroutine calls to the machine. The parameters passed to the machine represent an operation code and addresses in the instru- tion set of an imaginary computer designed to execute COBOL. This is essentially Wilcox's concept of a "source language machine." The machine then interprets this instruction set. As the interpreter developed, the division of func- tions between the parts became less distinct. The super- visor is in control of input-output and branching, using parts of the machine as subroutines. But the division into two parts remains as the fundamental organization of the interpreter. 4.1 Primary data structures Tying the two parts of the interpreter together is a common data structure, the operand list. Entries in the list are initialized by the supervisor and modified by the machine. An entry in the list contains all information needed by the machine about a particular operand. This may include the data type of the operand, its length in charac- ters, its number of decimal places, its storage location, whether it is a signed field, its binary value, whether its binary value has been determined, the symbol table pointer to the operand and the symbol table pointer of the operand's 23 picture. The address of a data item within the machine is represented by a pointer to the operand list. Another important data structure is the symbol table constructed by the COBOL editor. It contains static information about each symbol in the source program, such as its length, location and relationship to other items in a data structure. Details of how the symbol table entries are used for various symbol classes are included in Appendix E.I.; this information is needed because the names of the symbol table entries do not necessarily reflect their usage in COBOL. Anyone examining the lessons in the future will have to refer to documentation to understand many of the statements involving symbol table entries. In two cases symbol table fields are not static but are used by the supervisor to store information. Fields in the symbol table entry for a file are used to indicate the file status and to hold the offset of the current record from the first character of the block. While executing a PERFORM the symbol table entry of the last paragraph of the PERFORM range is modified to indicate that an exit is needed. Discussion of other data structures is included with the discussion of the related statement. 24 4.2 The supervisor 4.2.1 Interaction with the student To a large degree the COBOL interpreter runs with- out student intervention. The student is involved in three ways: choosing the execution option, supplying input and responding to error messages. The student may choose between three methods of execution. One provides a complete trace of the program, with all changes in variables displayed and a box drawn around each paragraph name as it is entered and around each verb as it is executed. A second method includes the state- ment trace but not the variable trace. The third has no tracing; the only information the student receives about the progress of the program is if a READ, WRITE or STOP is exe- cuted or if an error occurs. The full trace method will probably be most often used, since with it a student can see exactly what his COBOL statements are doing. The supervisor asks the student to enter input data whenever a new block of data is needed by a READ statement. Since blocked input files are included in the subset, not every execution of a READ causes an input request. If the student indicates that there is no more data, the AT END branch of the READ is executed. If he has data to enter, the supervisor asks for input for each elementary item in 25 each record of the block. To do this the symbol table in- cludes pointers to the "son," "brother" and "father" of each item in the data structure. This structure is taken from Knuth [5] as is the algorithm for traversing the structure to reach every elementary item. The WRITE statement does not require any student intervention but it is discussed here because it is related to the READ. Because COBOL is often used to generate reports, it is beneficial to be able to see output as it nor- mally appears on a printed output rather than in the few lines available on the same screen display as the COBOL pro- gram. Therefore, the number of records per block of an output file is defined as the number of lines per page to be seen on a screen display consisting solely of the student's output. If the student forgot to assign values to any parts of the output record, those parts contain triple question mark characters to alert him to his oversight. Whenever any part of the COBOL interpreter detects an execution error, an appropriate error message is displayed. The student then has the choice of terminating execution (hopefully to return to the editor to correct his program) or of taking corrective action. For some errors, the cor- rective action is fixed. For example, the corrective action for a read of an unopened file is to open the file. If the error is an invalid numeric value, the student is asked to 26 supply a correct value to replace it. This includes correct- ing an out-of-range subscript or replacing a nonnuraeric character in a numeric field. The student may receive help in correcting some errors by pressing the HELP key. 4.2.2 Expression evaluation In the COBOL subset arithmetic expressions may ap- pear in COMPUTE statements and in conditions in IF and PER- FORM statements. The expressions appear in infix order in the intermediate text but must be evaluated according to the precedence rules of the operators. A complication is that the number of decimal places to use for intermediate results can only be determined after the maximum number of decimal places in all operands is known (this problem is discussed further in Section 4.3.1). Therefore, in order to avoid two scans of the intermediate text, one to determine the maximum and another to execute the expression, a postfix representation of the expression is constructed as the expression is scanned from the intermediate text. The infix to postfix translation uses the operator precedence algorithm given by Gries [2]. The operators are the arithmetic operators +, -, * and /; the relational opera- tors <, = and > ; NOT; the NUMERIC test; and assignment. The "f" and "g" precedence values and the machine operation codes corresponding to the operators are stored in otherwise 27 vacant fields for predefined entries in the symbol table. A stack is used for operators, while operands are added to the previously mentioned operand list. The postfix representation is a queue of operations to be performed. Each entry in the queue has an operation code and two pointers to the operand list. If one of the operands is an intermediate result, the pointer for it in the operation queue may be wrong. However, the machine can detect the error and correct the pointer. As each operand is added to the operand list using unit "address" the maximum number of decimal places in any operand is determined. After the entire expression has been scanned the machine is called to execute all of the operations in the queue. 4.2.3 The PERFORM statement Several options of the PERFORM verb are included in the COBOL subset, requiring a fairly large statement driver in the supervisor. Control of the PERFORM is in the supervisor; the machine is used only to evaluate conditions and determine values. To save information needed about all PERFORMS currently in effect, a stack is used. Each stack entry in- cludes the first and last paragraph of the PERFORM range, the 28 paragraph containing the PERFORM, the location of the PERFORM in the intermediate text and, if the TIMES clause was used, the number of iterations remaining. If a paragraph is the last paragraph in the range of a PERFORM, its symbol table entry contains a pointer to the perform stack. At the end of execution of the para- graph, this pointer should match the current perform stack pointer. If not there must be recursion or overlapping ranges in the PERFORM statements. This error always causes an end to execution, because the supervisor cannot repair an incorrect PERFORM structure. If the pointers match, control is transferred to the PERFORM statement to decide whether another iteration is needed. This scheme implements the PERFORM verb exactly as in standard COBOL. Nested PERFORMS are valid if their ranges do not overlap and if no paragraph is called recursively. 4.2.4 The GO TO statement The branching of the COBOL program within the inter- mediate text is done by the GO TO statement driver in the supervisor. The DEPENDING ON option is implemented using an array, constructed during the interpretation of the GO TO, to save the symbol table pointer of each possible des- tination which is then indexed by the value of the named variable. This array cannot be replaced by the simple tech- nique of using the index value to locate the intermediate 29 text entry of the destination/ because one or more paragraph names might be continued between lines, causing an extra entry in the intermediate text in addition to the blank token between each paragraph name. 4.2.5 Other statements The OPEN and CLOSE statements simply set a value in the symbol table entry of the specified file to indicate the file's status. An illegal file status in any of the input- output statements results in an error message. CLOSE also writes any partially full block onto the screen. The ADD, SUBTRACT, MULTIPLY and MOVE require very little effort in the supervisor since their actual execution is done by the machine. The statement driver routines in the supervisor call the appropriate subroutines needed to organize a machine "instruction," then call the machine with the assembled instruction. The STOP statement terminates execution of the pro- gram. Any symbol table entries that were changed during exe- cution are reset to their initial values. The student can choose to see a page of execution statistics, including such items as how much CPU time and how much storage for data items was used. 4.2.6 Unit "address" One unit of TUTOR code in the supervisor is so 30 central to the interpreter that it deserves a detailed dis- cussion. Unit "address" prepares the operand list entries for use by the machine from symbol table entries and sub- script values. Its importance is that it organizes informa- tion about an operand into an efficient form for use by the machine. Its most complex function is to determine the off- set of each item from the start of the area representing the core of the COBOL machine. Because the character table and the core both contain seven-bit characters, the character table can be used as if it were a part of core. This is used for constants so that, to the machine, constants and variables look almost alike. No core space is wasted dupli- cating the character table and no extra moves need to be made. The offset and length fields for constants in the operand list are set to exclude the quotes surrounding char- acter strings and to exclude signs and trailing periods in numeric constants. To determine the effective offset of a data item three values are added together: the base offset contained in the item's symbol table entry, the displacement of the current record from the first record of the block and the dis- placement of this occurrence of the item from the first oc- currence of the item. The base offset is the location of the location of the leftmost character of the first (that occur- rence with a subscript of one) or only occurrence of the item 31 in the first record of a block. By using a pointer in the data item's symbol table entry, the symbol table entry of the appropriate file is reached; an entry in the file's symbol table entry contains the record displacement (if the last record read in an input file was the ith in the block and the record length is I then the record displacement is £(i-l)). Items in WORKING-STORAGE always have a zero record displacement. If the item has a subscript, the third value is determined by first obtaining the value of the subscript by recursively calling "address" and calling a routine in the machine. An field in the item's symbol table entry points to the item with the OCCURS clause; the length of the latter item and the value of the subscript determine the occurrence displacement (if £ is the length and i the sub- script value, the occurrence displacement is £(i-l). The other fields of an operand list entry are re- formatted symbol table information or are initialized to zero. One exception applies to numeric constants. In order to avoid repeated decimal- to-binary conversions, the con- stant's binary value is determined once, then saved in a symbol table field (if it can be expressed in 12 unsigned bits) . This value is copied by "address" into the value field of the operand list. 4. 3 The machine The machine operates in three modes: binary, 32 decimal and character. The mode of an instruction is a func- tion of the operation code and the types of two operands. Because all arithmetic operations are done in binary mode, the binary mode subroutine is called directly by the super- visor for ADD, MULTIPLY and SUBTRACT statements. For expres- sion evaluation, including comparisons, and for MOVE state- ments a three-dimensional array, initialized at the start of interpretation and referenced upon entry into the machine, determines the mode. The subscripts of the array reference are the types of the two operands and the type of operation code; the values in the array are 0, 1, 2 and 3 indicating illegal cases, character mode, decimal mode and binary mode, respectively. The machine has an instruction set of 12 commands: 1 divide 2 multiply 3 add 4 subtract 5 complement algebraically 7 move 8 store 9 compare for less than 10 compare for equal to 11 compare for greater than 12 complement logically 15 test for numeric 33 In addition one subroutine of the machine is often called directly to return a value needed immediately by the super- visor (for example when evaluating a subscript) . When evaluating an expression the machine executes each instruction in the queue prepared by the supervisor. As mentioned earlier some of the operand list pointers may be incorrect. This is determined by checking the format of the operand pointed to. If it is null, the operand list is searched sequentially for the first operand whose format is not null; this is the correct operand. For involved expres- sions requiring many intermediate results this algorithm is rather inefficient. However complicated expressions should be rare in most COBOL programs. This algorithm does permit a convenient scheme for allocating intermediate results. Although two operands are used to determine the mode, the machine executes instructions using zero, one, two and three operands depending on the instruction. For example, logical negation has no explicit operand (it uses a reserved variable) while addition has three. The sum of the first two operands is stored in the third. If zero is specified as the third operand, the machine is to establish an operand list entry for an intermediate result; it will be in one of the slots vacated by erasing the first two operands from the list. This arrangement proved to be very flexible; it was developed after investigation showed that a fixed number of operands would be cumbersome. 34 4.3.1 Binary mode Binary mode is by far the most complex of the three modes. It includes all arithmetic and editing operations as well as moves and compares involving binary operands. The central problems faced by the binary mode arith- metic units have been clearly stated by Lippit [6]: (1) How can we achieve the same arithmetic result on a nondecimal machine as on a decimal machine? (2) Regardless of machine type, what are the rules to be followed in performing the arithmetic operation? Lippit' s solution to the first problem is used: simulate decimal arithmetic keeping track of decimal point alignment. To do this each value is represented as integer- valued floating-point number and a power of ten. This avoids the representation errors in noninteger floating-point num- bers which do not occur on a decimal machine. The rules to be followed are partially described by COBOL options. The ROUNDED option requires that results be rounded, but because this option is not available in the subset results instead must always be chopped. Although the SIZE ERROR option is not part of the subset's syntax, it is implemented for all arithmetic operations as an aid to the student in debugging his programs. Checks for overflows causing loss of significance are made. If an overflow occurs, an error message is displayed so that the student may enter a smaller value. 35 The number of integer and decimal places to be carried in intermediate results is not specified by ANSI. The rules used for intermediate results are essentially those given for IBM 360 COBOL [3] . These rules specify how to carry the maximum number of significant digits in each intermediate result based on the number of integer and deci- mal places of each operand and on the maximum number of deci- mal places of any operand. The only modification made was to reduce the maximum number of significant decimal digits from 30 to 14 in order to fit any value into one CYBER 73 word. This is a mild restriction since 14 should normally be ample. Binary mode must convert all decimal operands to binary, perform its computations in binary, then convert the result to decimal if necessary. The binary-to-decimal con- version is aided by a TUTOR command for this function, but no decimal-to-binary conversion is available. The decimal- to-binary routine verifies that each digit position does in fact contain a digit. If not an error routine displays the illegal character and accepts a correction. Also included in binary mode is the editing of numeric edited fields. This includes suppression of leading zeros, replacement of leading zeros by asterisks, fixed and floating dollar signs and minus signs, and insertion of periods, commas, blanks and zeros, as prescribed by picture strings. Because there is no equivalent instruction in 36 TUTOR, a fairly large subroutine is required. Information about the picture stored by the editor in the picture's symbol table entry, as well as the characters of the picture string, dictates the progress of this subroutine. 4.3.2 Decimal mode The move and compare operations are executed by the decimal mode routine in a direct manner. The operations proceed one character at a time from left to right in the decimal operands. Decimal point alignment is accomplished by appropriate initialization of the pointers to characters within the operands. As in the decimal-to-binary conversion each digit position must contain a digit or else an error occurs. 4.3.3 Character mode This is the least complicated of the machine's three modes. Its operations are moves, comparisons and numeric tests. They proceed left to right one character at a time, with truncation and padding with spaces in moves and with extension of the shorter operand with spaces in comparisons. No error conditions are possible. 37 5. DOCUMENTATION PROVISIONS As with almost any system of programs , the PLATO COBOL system will probably require changes in the future. Therefore documentation is important as a source of guidance to someone who needs to understand and change the COBOL tables or lessons. Hopefully a person with the proper background who carefully studies the documentation will acquire a thorough understanding of the COBOL system. Changes may be needed for many reasons. Both PLATO and the compiler-writing system are relatively new and may be changed considerably. Changes in either might require changes in the COBOL lessons or might permit improve- ments in them. Other features might be added to the COBOL subset, although currently space restrictions prevent this. It is possible that there are undetected errors in the system which need to be fixed, although the system has been thoroughly tested. In order to fully understand the COBOL system, a person needs to have a solid background in several areas. Of course he needs to understand the principles of compiler construction and of the compiler-writing system and he needs a good knowledge of the TUTOR language. In order to under- stand the rules of COBOL that are imposed upon the student's program and obeyed by the interpreter, he needs a detailed 38 knowledge of COBOL, or at least a fair knowledge plus a handy reference manual. Documentation separate from the programs it documents can easily become obsolete as changes are made to the programs. To reduce this problem most of the documentation is included with the programs, accessible to a future author through his PLATO terminal. This should encourage the future author to change the documentation whenever he change a program. The only exception is this thesis, which is an introductory guide to the structure of the COBOL system and to the major problems encountered in it. The thesis is more general than the other documentation and less subject to change . Two sources provide information about the COBOL subset. One description of the subset, which uses standard COBOL notation and explains many features of the COBOL system, is available to both students and authors in lesson "trw2" and is included in Appendix A. Another description using an extended BNF notation is included within lesson "cobolcomp." Also in "cobolcomp" are a guide to all docu- mentation, an explanation of how fields of the symbol table are used for different syntactic classes, and an explanation of the modifications made to accommodate two sets of lexical tables. 39 The tables of the system are maintained by aux- iliary programs of the compiler-writing system and may be easily inspected. Most of the COBOL tables, given in Appendix B, can be understood just by studying their entries. The lexical node table is an exception; it is very difficult to follow the lexical recognition of a token by inspecting the table. To clearly display how the node table constructs tokens, a short TUTOR lesson to generate transition diagrams based on the node tables is available; a sample is contained in Appendix D.l. The most detailed documentation is provided by extensive comments included within the programs ( "cobolcomp, " the syntax program, and "cobolrun"). The comments explain the function of variables and tell the purpose of program units and of the more obscure statements. However since the comments presume a knowledge of the more general documenta- tion, the program listings should not be the first docu- mentation studied. As further documentation for the interpreter two TUTOR routines provide graphic representations on a PLATO screen. One is a set of diagrams showing how the units of "cobolrun" are related (Appendix D.2); the other is a diagram displaying the table that determines the mode of the machine (Appendix D. 3) . 40 6. CONCLUSIONS The implementation of the interactive COBOL com- piler system on PLATO has demonstrated the general suita- bility of the compiler-writing system to COBOL. Although we have seen that COBOL is not ideally suited to the system, the system is sufficiently flexible to accommodate almost all requirements of COBOL. While the table-driven system is available for the editor part of the compiler, the interpreter part is a program written exclusively for COBOL and required much more time than the editor. An extension to the compiler- writing system to include some form of language-independent interpretation is a large and difficult area for further research that could significantly reduce the time needed to implement a new language using this system. The COBOL system has also demonstrated the restric- tions that the current PLATO system places on large lessons requiring a relatively high usage of processor time. PLATO memory restrictions are the primary cause of the size limitations imposed on the COBOL subset and on COBOL pro- grams. The rate of CPU usage needed by the COBOL system exceeds the PLATO average (designed for lessons with many fewer calculations) and causes slower response times than nor- mally found on PLATO. Because the COBOL system has not yet 41 been used by large numbers of students, it is uncertain to what extent these problems will limit the system's useful- ness. 42 LIST OF REFERENCES 1. Armstrong, Russell M. , Modular Programming in COBOL , John Wiley and Sons, New York, 19 73. 2. Gries, David, Compiler Construction for Digital Com- puters, John Wiley and Sons, New York , 1971. 3. IBM Corporation, IBM OS Full American National Standard COBOL , 4th edition, 1972. 4. IBM Corporation, IBM System/360 Principles of Operation , 9th edition, Poughkeepsie , New York, 1970. 5. Knuth, Donald E., The Art of Computer Programming , Volume 1; Fundamental Algorithms , Addison-Wesley , Reading, Mass. , 1968. 6. Lippet, A., "COBOL and Compatibility," Communications of the Association for Computing Machines , V (May 1962) , 254-255. 7. Lyman, Elisabeth R. , PLATO Highlights , Computer-based Education Research Laboratory, University of Illinois, Urbana, Illinois, 1974. 8. Nievergelt, Jurg , Reingold, E. M. and Wilcox, T. r. "The Automation of Introductory Computer Science Courses," International Computing Symposium 19 73 , 495-501, North- Holland Publishing Co. , 1974. 9. Stifle, Jack, The PLATO IV Architecture , Computer-Based Education Research Laboratory, University of Illinois, Urbana, Illinois, 1971. 10. USASI Working Group on COBOL Standards, COBOL Informa - tion Bulletin #9 [proposed USASI standard COBOL] , USA Standards Institute, New York, January 196 7. 11. Weinberg, Gerald M. , The Psychology of Computer Pro - gramming , Van Nostrand Reinhold Company, New York, 19 71. 43 12. Wilcox, Thomas R. , "Generating machine code for high- level programming languages," Ph.D. Thesis, Department of Computer Science Report No. TR-71-103, Cornell University, Ithaca, New York, September 19 71. 13. Wilcox, Thomas R. , "The Interactive Compiler as a Con- sultant in the Computer Aided Instruction of Programming," Proceedings of the Seventh Annual Princeton Conference on Information Sciences and Systems , 396-399, Department of Electrical Engineering, Princeton University, Princeton, New Jersey, 19 73. 44 APPENDIX A COBOL HELP LESSON Appendices A, B, C and D consist of copies of displays seen on a PLATO screen. This appendix is the description of the COBOL subset contained in lesson "trw2" which the student can reference while writing his program in the editor. 45 COBOL Subset on PLATO The following pages give a description of the COBOL subset implemented on PLATO. It is assumed that you have some knowledge of COBOL fundamentals. Press : for : 1 General Information 2 Format by Columns 3 Character set 4 Syntax Notation 5 DATA DIVISION 6 ; Pr i nt F i 1 es 7 PROCEDURE DIVISION ( help) Explanation of Keys Used 46 General Information about PLATO-COBOL This compiler is intended for use by beginning students of COBOL. A subset of COBOL is recogized which should be sufficient for this purpose. The size of a COBOL program is restricted to the size of the PLATO screen. Since COBOL programs tend to be large, this is a significant restriction. In order to minimize the problem, some modifications to standard COBOL have been made. One is the column format, as given on the next page. A second change is that the IDENTIFICATION DIVISION and the ENVIRONMENT DIVISION are not included. You begin your program by entering FD in columns 2 and 3. All files must have LABEL RECORDS OMITTED. It is assumed that it has been ASSIGNed to the PLATO terminal. This means that all input must be supplied by the student through the keyboard, while output will be displayed on th< screen . 47 sO T X vO CO X sO CM x £ 10 vO _t X Q vO CSJ X •»* "■' L- LTt CT> x <— t ■ LA CO X » /— % tr> r* X 10 to ^o la vO X 3 ij 1 ■ in LA la 1- co X X X • 1-4 > £ g "O ^ I LA CM X X rd 10 tun •— • XI -*- CO X J. ►-H «T CO X O -+J CL 3 I— 1 X U- ■*• CM X t- c rd id i T *-4 X <«-■ i. 3 C 5 CO CO X ■d 1J s: - X c t- T> 4-» C" •— < 0. CO vO X e -+ CO CO X t—t £ 8 CO **« X L. • ■-< o * ^H •d • 1J 1J CO cq X f— 1 m r— H hH tlO o 3 vO c rd rd *—i vO X C ^ 10 »-H rd -M r— 1 Ld 4-' +> i—i LA X • ■ rd c > • •-• 3 \>1 *-* T X »^ ■ ■ £ £ M »— « T> Cl u • • r-t co X X t—t Ifl I # X L.. 4-' O LA f— 4 w—\ X ti c co f—4 *—* t • r— H X X r£ 3 a. CM •— « - u 48 4-» (M 1— 1 m Q V U "0 •— t lQ c .0 U iTJ tH x. i. id 4J V > -P id 10 3 id vD t- CO U Q_ V 3 — ' "0" P id id u u ■ »4 .— « 10 (U ul t- 10 r Cl ^ id m ,i- id • l-« .— < ■— i id m Q_ r— * r— « a D -h o. (0 id id £ i- ■ »H id C OJ 10 y id a> t- 4-' y g aj X y -p • 1— 1 in +» 10 •r-< ■•— i »— i >- '1' X ■ t—t • t-i A- 10 — 1 Cl . — i w— H 1) y •d $- 10 •— < X- 10 ■B- •3 e> i \ 49 Explanation of Symbols Used in Syntax Descriptions: CRPS Required keyword CRPS Opt i ona 1 word small User-suppl ied word or literal i { } [ J Choice to be made Opt i ona 1 phrase Optional repetition of previous entry 50 DATA DIVISION Press. . . for. . . 1 File Description Entries 2 Record Descr i pt i on Ent r i es 3 Alphanumeric Data- items 4 Numeric-edited Data- items 5 Numeric Data- items 6 Ot her i n format i on Mb) to get back to this page 51 File Descriptions FD file-name L6BEL (BECORQ IS 1 quitted \beqqbqs are/ TbLOCK CONTAINS integer /CHARACTERS!"] L L RECORDS Jj ("RECORD CONTAINS integer CHARACTERS"] . only fixed length records are implemented 52 Record Description Entries level -number item-namel EILLEB J BEQEEINEjS item-namel OCCURS integer TIMES VRLUE IS literal ] ruSRGE IS ( BISPLfiY T \COMPUTRTIONRLJ_ PIC picture -string on 1 y 1 1 eve 1 o f subscr ipting is all owed see next topic for details of acceptable pictures level number may not be 6 6 or 8 8 To insure that there will be enough space for your input, make sure that no elementary item in an input file is larger than 7 5 characters! ! ! 53 Alphanumeric Data- items An alphanumeric data- item (AN) is an item whose picture contains only the letter X. The repetition factor may be used; this means that XXXXX and X (5) both are valid pictures for a field that may contain any 5 characters. 54 Numeric-Edited data- items (NED R numeric-edited data- item (NE) is one whose picture contains at least one of the following: S - * Z . , and B. It may also cor tain: 9 and V. The symbols > P CR and DB which are part of standard COBOL numeric-edited pictures are not available on PLRTO. The minus sign - may not appear at the right end of the picture. 55 Numeric Data- items R numeric item is one whose picture has at least one 9. It may have S and V. P is not available. R numeric item is assumed to be in external decimal format (ED) unless its USAGE is COMPUTRTIONRL, in which case its format is binary CBI) . USRGE COMP in PLRTO-COBOL may only be declared in WORKING -STORAGE, and pictures for COMP items must have an S and 8 9s [for example S9 (8) and S9(6)V9 9 are valid] . The SYNC clause may not be specified, but it is implicitly in effect for all COMP items; each COMP item is 4 characters long. Using REDEFINES together with COMP is strongly discouraged. The max i mum number of digit pos i t i ons wh i ch may be specified for a ED item is 14 (normally 18 digits are a 1 1 owed) . 56 Other Info on DRTR DIVISION Alphabetic items (pictures with R) and alphanumeric-edited items (pictures with X R B , 0) are not available. 57 OUTPUT "PRINT" FILES 1. All output will be displayed on your PLATO screen in the same way as a COBOL file is written to the printer. The screen has 3 2 1 i nes , each 1 i ne has 6 4 pos i t i ons . 2. The record size should be 65 characters or less. This must include 1 position (the first) for a compi ler -generated control character. Do not move anything to this position; it won't be shown if you do. 3. A block of a "print" file is considered by this compiler to be a "page"; that is, the amount of print output to be displayed on the screen at one time. This means that if the BLOCK CONTAINS clause is omitted or is 1 RECORDS, the output will be shown one line at a time. If, for example, BLOCK CONTAINS 15 RECORDS, no output will be shown until the 15 WRITE. Biecause the maximum number of character that can be stored is 17 92, the absolute maximum number of 6 4 character lines/page is 2 7 (this would leave only 3 7 characters for all other data). 58 p ress. . . for. . . 1 ADD, CLOSE, COMPUTE, EXIT, GO, IF, MOVE, MULTIPLY 2 OPEN, PERFORM, READ, STOP, SUBTRACT, URITE 3 Legal MOVEs 4 Legal Comparisons 5 Types of Conditions Available 6 Other Information Ms) To return to this page 59 ADD /data-item] jq data-item \ literal J ADD < T c ' a ^ a " * tern"! fdata-iteml I literal J \ literal J GIVING data- item CLOSE f i le-name .... COMPUTE dat a - i t em = ar i t hmet i c - express i on EXIT Gy TO paragraph -name GO JO paragraph -name DEPENDING ON data- item IF condition ftEH SENTENCE^ ^ fbJEXI SENTENCE \ [statement . . . , j (statement .■••/_ MOVE fdata-iternl T0 data -item ( literal J MULTIPLY /ciata-iteml BY data-item k literal J "" MULTIPLY /data- item I gy Jdata-iteml GIVING data- it { literal J \ literal J em 60 OPEN A^PUI I file-name... lOUIPLJIJ EEEEQEd paragraph-name IHRU paragraph -name fdata-iteml TIMEs" 1 \ integer J PEREQBd paragraph -name IHRU paragraph -name VARYING data- item ERQM (data- i tern 1 gy fdata-iteml 1^ literal J ^ integer J_ UNTIL condition READ file-name AT END statement.... STOP RUN SUBTRACT fdata-iteml ppg f j da t a -item { literal J SUBTRACT /data- iteml FR0M fdata-iteml GJV iNG data-item ^ literal J " \ literal J " UJRITE record-name |BEF0RE ADVANCING integer LINES 1 61 V M 4-" c c Numeric COMP u X X X z z z Z id .0 > 4-» o m £ d £ Numer i c DISPLRY u z X X z z z z ~ £ E - E i- Group item u u u u (J X (J o C = nonnume X = illegal h- / /n / &■ / L " £ 4-» • ■-• CL d R 1 phanumer i c item Numer i c Edited item SPRCES or Nonnumer i c 1 iteral o a: u N Numer i c literal Numer i c DISPLAY item Numer i c COMP item 62 V u iTJ c £ •— i d r— 1 c c •l-« II 1 II u z X <~ X X z z z z 4J T> -H V • i-H CL • t-t 1— 1 V u (d o V i. u £ -< J- C t. • 1—1 >— H o iTJ V u Zi E u £ 4J c • r-l • i-H U-t d £ t- c ri ^. ->_ '1' y~ ITS C V i- n u o (U ) and the test for NUMERIC. Other class tests, sign tests and condition -name tests are not provided, Implied subjects or relational operators (such as "IF ft = B OR C...") are not allowed. Compound cond i t i ons may be formed by connect i ng s i mp 1 e conditions with ftND or OR, but FIND and OR cannot be used in the same compound condition. NOT cannot be used as a logical operator, but may be used in relation tests.' This means that IF ft NOT = B is ok, but IF NOT ft = B will cause an error message. , 64 Other Info about the PROCEDURE DIVISION The ROUNDED opt i on is not ava i 1 ab 1 e ; no round i ng will occur. Although SIZE ERROR cannot be specified, it is in e f feet at all t i mes ; you will get warn i ngs at exect i on t i me if arithmetic overflows occur. Full expressions may be written in COMPUTE statements and in conditions, except that exponentiation (**) is not provided. Each sentence, including the first one, must be in a paragraph . Sect i on names can ' t be used , however . Fit the end of your program, you must put END in area A (columns 2-5) followed by a space, then press (stdp) . 65 APPENDIX B COBOL TABLES IN THE COMPILER-WRITING SYSTEM All COBOL tables used by the language-independent editor routines, except the syntax code table, are included in this appendix. The displays shown here are not seen by the student writing a COBOL program but by the COBOL imple- mentor when constructing or modifying the tables. 66 B.l Primary tables Press. . . To change. . . a Name of lar.ga.Lige (COBOL) b Name of character set (COBOL in trui2) c Editor leslist index <15>: (cobolcomp) d Interpreter leslist index <20>: (cobolrun) e Internal character codes (64 codes) f .' . Blank code (1) : g Default tabs h Key Fu.nct i on Tab 1 es i Lexical Class R,=.signments (20 classes) 1 " j Lexical Node Table (30 nodes) k Safe Nodes 1 1 Prede f i ned Sy mbo Is (110 names , 565 char act ers) m Field Symbols n New Symbol Allocation Classes flSTaBflcfl to return tables to -trw6 67 B.l.l Internal character codes Internal Character Codes 16- / 32- E 48- U 64- # 1- . 17- , ; 33- F 49- V 2- $ 18- * 34- G 50- W 3- . 19- _ 35- H 51- X 4- < 20- > 36-1 52- Y 5- ( 21- ? 37- J 53- Z 6- + 22- : 33- K 54- 7- 1 23- # 39- L 55- 1 8- & 24- (3> 40- M 56- 2 9- l 25- • 41- N 57- 3 10- $ 26- = 42- 53- 4 11- * 27- u 43- P 59- 5 12- ) 28- R 44- Q 60- 6 13- • 29- B 45- R 61- 7 14- -i 30- C 46- S 62- 8 15- - 31- D 47- T 63- 9 68 B.1.2 Initial tab settings vO 1- vO co vO (M v£> *— 1 sO S} LT« 0> LTV CO ITi rs. ir» "T IT» CO /"^ lf» CM -4-» IA «-• «u in cq 10 T o> Ji T CO -13 T r^ +> T VO ii f ir> Ik T T ^^ n- CO CM io 4-» CM CO cm r^ CM nO cm in cm t CM CO CM CM CM — • CM Sj — • ov *-+ CO »-■ I s * t- i vO •^ ir» •^ CO ~* CM »■* »-• o* CO r>» vO ir» «T CO CM ^ 69 B.1.3 Key function tables Press. . . For. . . 1 Lower case keyboard ■ 2 Upper case keyboard 3 Function keys 4 Lower case access keyboard 5 Upper case access keyboard 6 Recess f unct i on keys Press frfiCKj to return to index page Press (help) to locate a table by key Press EffJUHELP] for 1 i st of spec i a 1 f unct i on codes I • 70 -1 Ignore key -2 Move cursor 1 character to right. -3 Move cursor right one token .-4 Move cursor right one line -5 Erase character to right -6 Move cursor left one character -7 Move cursor left one token -8 Move cursor left one line -9 Erase token to right — 1 JBT Erase character to left of cursor -11 Erase token to left of cursor -12 Erase line to left of cursor -13 Erase line to right -14 Recess alternate key set - 1 5 Tab - 1 6 Open " gap " one 1 i ne . -17 Clear screen -18 Return to index page - 1 9 CI ose " gap " by one 1 i ne -20 Help sequence 1 - 2 1 He 1 p sequence 2 -22 Switch' lesson to backgound - 2 3 Cornp i 1 er debugg i ng a i ds -24 Move cursor to end of text -25 Unassigned -26 Switch lesson to foreground -2 7 Set tab -28 Clear tab - 2 9 Repr i nt screen -30 Move cursor t^ next. line 71 * % *- ^% *- "* r J" * » - - 5 \ # <2> ^ * it V ^ ~) Q «-• CM CM «-• »-• _ ^* ^ CO (Ml '-• I I I n ii it ii ii n ii ii ii ii ii ii ii ii ii ii H V 3 i i i i i i i i i I i I I I i I S CO CT> -S3 •Hi\(O^"lftvON00ff*t5'- • roilS^M.OO'Oin^^DlJ^W^vD^NO 3 LA \0 vO vD vO »-• «-« *-* »-•»—• CM «-» . _ II II II II II II II U 1ft <0 N CO 0> + I II II II II II II * \ w yv & II II II (_ I I I I I I I I I I I 1 I I I I l )lNCOtin»flNCO^C5'HNCOtlA\ON Eoicofoncoorocottttttrt C 3 w Z CO Ql(ni-D>3X>-NiS-N(ot lftvDNCOO>iS!- , C s JCO , l"U , > ii ii ii ii ii ii ii ii ii ii ii n it ii j. i i i i i i i 3 X X N iS| ^ N CO t I I I I vONOO^iS^iNCOtU^vONCOC^Cq^ «-«»-•-*— «CMCMCMCMCMCMCMCMCMCMCOCO (E(QUQyii.OlHhyJEZO CO^C5^CMCOtlA^ONCOCI>Cg'- i i i i i i i i i i -*c\JcoTir>\0r^cD(j»cq^c\jc r ) i ii C i ii I IA Cfc" ^r vO CO -«r IT. iD I s - CO Cfr f--- CO CT- £? •*—< CM CO LA LA LA *o ^o vO .'>0 3 X >- N CS> CM S; CM CO ^r LA vO la LA LA LA la IA IA Q_ o or in 1- ID ;> CO T LA *o r*. CO o* V _l T~ Z O i 1 1 i 1 i i u vO r^ CO o> iSJ »— < CM CO CO CO CO T T f u » a.' -i-' QD rj Q Ld L. E> •^-t CM CO f IA i- CM CO CO 0") CO CO CO m x. u • • # &• II S 1 1 1 1 1 1 1 C LA *o r-- CO ON ts »-* l-H CM CM c3 « # y \ 1 r 1 CO CJ» ^ *— * CM CO f 1 -e- • V \_/ + CM CO ^r LA vO r^ 72 ^tacqcsj^c^^cqcqteacsjcsatscQcsjcM ir) CM CM ™ II ) bJ II II II II II II II II II II II II II II II II CD ~1 | I I I I I I I t I I I I I I 1 =3 — ■w* CM CM CM -^ II II II II II II II II II II II II II II II II O I - VA < O =• — i5 ^ (M (O 1" lA ^O N CO ^ >5 cr»cr>cr>ii5J!3C5<^C5iS)tS}iS)t3i3'^'-« • — t CntlAMDNCOOsig-iMClCSllSlCSlSlS! T , 3X>N i i i i i i i i i i i i i i i i OD(ococo(DcoK)cooaccia»CT»o. o»cr>(^ (ECDUQU OlHhYJEZO S) CO CT> C3 •-• CM CM CM CO <*> CI ^"LrtvOr^COCr»t3^Csl •J- •■_> M n-' .J I i v£> 13 H I' li II ii II ll ll n ti ii ii n ii ii CtQUQUkOlHh^ JEZO i i i I i i i I I i I I I I I *£>vovDvovor^rN.r>.r^f^r>.r^r^rN.rs. i • CO 1- in iS) CM CO in in in \D vO sO ^o 3 X > N C3 «— I CM I es CM CO ^r in *0 in in in in m in in Q_ o q: CO h- 3 > 1 CO «r in vO rx CO OS m- m- ?r ^r T f ^r 10 V TI n »-) ^ _J 2— -z. o i i i i 1 i 1 u SO r-- CO a> G> ■r- « CM CO CO CO CO *r f *r u V 4-> fO rji Q Ld L. O X i i i i i | i CJv C3 —» CM CO f in i- CM CO CO CO CO co CO ITJ JC u ■ « 1 # e> ■ II = i ^ CM CO ^r in vO r^w CO m CM CM CM CM CM CM CM c i- V 1 \ m ^ 1 /s. O- 4-» 1 1 1 1 1 1 1 c in ^O r^. CO c* fej «-« HH CM CM «3 -• W * <^->w r CO c* &> CM CO *• -B- • V >_/ + *P-* CM CO *- in vO r>* 73 »-«cT»ir»crv' , l'"TcO'^«Lf» I Csl i i — • -« *— i •-• i til i it ii ii ii ii ii •r-4 i ^H <•— * *~t -< IS X-4-" 4-' J- t- CL Q. 0. Ol --« ■ #-H _Q ~^» o T5 V.-' -•-« ■r-f -H 4-> *0 1 01 0) £ £ 10 fl +» I I I I I I I I I T IA \D'N CO O* iS} ^ C5^(MnTlf>vON N i 1 CM 1 1 *5 CM 1 CO i 1 IA 1 vO la LA IA IA LA IA IA CL | I in i 1 1 > 1 CO -r 1 LA i 1 1 CO 1 T T ^ ^r T T *• 0) . 0> TJ 1— 1 »-) ^ _l TT~" -z_ O 1 1 1 i 1 i i U \D r^. oo a> &J •»-» CvJ CO CO CO CO ^r M/ T <- oj 4-' 03 U Q Ld b_ e? I 1 i i i i i i iXS CT» G3 •r-t CM CO T la <- CM CO CO CO CO CO CO •TJ JC u • • 1 # 1 - ■ II 1 3 S) 1 1 CM i CO i ■ -B- | • i •^s + I 1 i 1 CM CO 1 LA 1 NO 1 74 3 d 6 c o o CM — « I I II II II n ii n it ii ii ii VI AJ II II II I I I I I I I I I I I I I I I "I COOi^'-«CMCO , t"lAsOr^COCr»C3«-«CMCO n* ^r ia ia la ia ia ia ia ia ia ia so «o si C5 S> S> s» C3 Si * S) si Si Sl t- = ^ b #— i 3 > ' ^\ CM CO T u- 1 9 1 i i i ', , i < i i 1 1 l 1 1 i <0 r^ CO c* S» ~* CM CO «r IA yO IN. CO O* si ri .— i •«-« *-* ~* CM CM CM CM CM CM CM CM CM CM CO CO CO CO u • - u u a: Si (M ca Si S| vO si Si 6P C5 Si si si St u CM CM CO 1 1 . CO CT» s> v-t CM CO T IA - i sO • • CO ■ T IA ■ \D 1 CO ■ C7> ■ CO 1 S} 1 1 CM i CO LA IA IA •o vO *o •o 3 i X 1 N s> | ■ CM 1 Si ^-, 1 CM i CO 1 T i IA %o IA LTi IA IA IA IA IA CL | CO H .3 > 1 co T IA vO r^. CO 1 OS ^r ^r : s> »-* CM CO CO CO CO T T "T u V -p 03 U a U L.. u I u i i ■ 1 i i 1 i «TJ CT> s> »— t CM CO «r IA t CM CO CO CO CO co CO •U X u ■ ■ 1 # 1 i I II 1 i a: ^_ CM 1 CO i IA 1 *o in. CO (Tl CM CM CM CM CM CM CM c J- . CO CT» Si t— i l-l CM «3 1 i | 1 1 ■ r I CO ON Si • »— « CM CO i 1 •e- • i V 1 1 + 1 I CM 00 "T IA vO r>. 75 fcaeafcatg^^s** 2 *^^^^^^^^ II || II II II II II II II II II II ii ii u II i i i i i i i i i i i i i i i i cvicoTinvDrv.coo^lsj'-'CMCo^rmvor^ „H^,^,-i.~t~*~*~4rMfMCMCMCMCMCMCM o fl J -\ -» ii ii ii ii n ii u u a ii ii ii ii n i i i i i i i i i i i i i i _ C5 03 C3 G5 ?S CS3 03 03 03 03 ^3 ^3 (S) 03 03 03 ii ii n n ii !i ii u n ii n ii n 0. O C£ 01 h- Z> > «- -► >- N n ii i i i i i i i i i i i i i i i i Cj-HNOTi/lvONOO^ISj^NOTin 03COCC0DC0CDCQCDCOCOCJ>CJNCT»CJ»CT»O , » ii ii n n n ii ii ii ii ii ii ii n ii n n 4 CO .rs.rs.r>.r s wrs.iN.r>. ■ , 1 vO CO ■ in ■ vO CO a. ■ r>- 1 CO 1 O^ C=3 1 CM 1 CO U', IT. in vO vO vO v£> i X 1 > t N C3 ■ -^ CM ■ C3 1 *— • 1 CM ■ CO 1 in 1 in IT> in in in in in Q_ i 1 CO- | 1 3 > 1 CO ^r in v£> 1 CO 1 ON ^r ^r n- T T T ^r m • \/ _l T - Z O i i ~i 1 1 1 i u vO r^. CJO CT> SJ »— i CM CO CO CO CO *T "T f u d M ,« •• d 11 *— « _ 00 »— « _ _ ^-. ^— « r^ 1 i v-4 i 1 1 1 1 cm ) 1 i II ii II ii II II II II ii P" > _x 4- 1 4-» ( J- a CL o a Cl - ^-< • •-* .Q .-< o CI "0 • <— 1 • ^ 4-> 4-> id M u c iO 10 4-» I.) i 1 1 i i 1 i 1 1 t'~ 10 10 10 ■0 in i.O 10 10 th 3 m UJ Ifl i.O iO 10 i.O i.O 10 •■•-« ij — s. u u Q d .0 «d ■d <0 o 00 o> cs ■^ CM i. ) r eg (M en CO 0") «— i ■*-■» *— i OD LA »-• «-• »-• »— • «-« »- • I I I I CM I I I I I I I ii ii n ii ii ii ii ii ii ii ii in cl d. ^4 M — • id ttf £ id — — O .£ X! -M 4-> S- 10 i- UJ a.i a? .ii iTj it itj rd a* c QJ ,C .C _0 _£ -- — "0"0-H id i i i i i i i i i i i 10 10 10 10 10 10 10 (0 (0 (0 to 10 10 10 to 10 10 i.O 10 10 10 10 d ib id id id id id i i i i i i i i i i i COl'IA\ONCD(Ti^rt(NJ(n cococococococoTf^J"^ I 1 vD CO I 1 LA 1 I ■ 00 1 1 1 1 1 1 CM 1 CO IA ITi LTi %D vO •£) vO I > 1 N eg eg I 1 ^ 1 CM i CO t i IA 1 vO IA LA it, LA U--I LA LA Q. | 1 1 to 1- 1 1 > 1 1 CO 1 LA \D 1 P- 1 CO a> ^r "T ,T 1- ^r T f 10 - OJ "0 n •-> ^: _l Z! Z O i i i 1 i i i u VD r^ CD cr> is ^^ CM CO CO CO CO • •— « CJ CO CO u CO CO (J CM u CO u u CJ CJ U N .. (J CO CJ «s» > X — - U 1-+ CO CJ CJ in CJ c 3 — SO iS» CJ in U > U CO CJ CO 3 in as CJ H CJ CM u CO r>. cn ■—1 CO U in U a: CJ CM u CM vO o> M» CO r>- CJ in o • ™ CJ CM u w-4 in 2 <-o u in CJ r # u CM u *■ _j o* • • • _, IA u in CJ x. 00 o- u CM CJ OS CO CO »-> r>. 1 •—4 *- CJ in CJ • X vO ^ CJ CM u CO CO CM cj in r in U o> U CO U in U • L. T ifi CM r^ • ^f CO cj 0") «— < • U r « i 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 i i 1 I 10 Cont i nuat i on field Press [hekt] to inspect the node table. Press [back] to return to the index page. 79 NODE CHiiKnL TER LLASSEb- 4* 1 (A) 2 (0) (.) (") (.) 1 3 27 10 8 1 1 1 21 X 1 E 21 X 2 1 1 2 E 2 E 2 E 3 1 3 4 X 1 E 4 4 3 E 7 8 X 3 E 3 E 5 3 E 13 10 N 3 E 6 6 4 E 7 4 E ,4 E 4 E 7 5 E 7 5 X 5 E 5 X 8 3 E 7 14 N 3 E 3 E 9 1 XI 1 XI 9 1 XI 1 XI 10 10 10 10 11 10 11 6 E 6 E 7 X 6 E 7 X 12 8 E 8 E 10 N 8 E 8 E 13 5 E 13 4 X 5 E 4 14 12 X 12 X 61 E 12 X 12 X 15 8 E 8 E 11 N 8 E 8 E 16 6 E 6 E 13 N 6 E 13 X 17 7 E 7 E 9 7 E 7 E 18 18 18 18 18 18 19 1 Fl 3 Fl 9 9 E 23 20 10 E 10 E 10 E 10 E 10 E 21 8 E 8 E 21 8 E 8 E 22 11 E 11 E 22 10 FE 11 E . 23 8 E 8 E 14 N 8 E 8 E 24 1 1 21 X 1 E 21 X 25 1 1 21 X 1 E 21 X 26 1 1 F2 1 E 21 X 27 1 XI 1 XI 9 1 XI 1 XI 28 15 E 15 E 3 R 15 E 15 E 29 8 E 8 E 29 8 E 8 E 30 1 R FD 2 R FD 30 4 R FD 5 R FD 80 NODE 44 *0 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 ChnRi-iL I Lk U-HSSES* 6 (0 7 16 0) 8 15 «) 9 (-) 10 (♦) 14 5 5 8 E 21 X 1 E- 2 1 E 2 E 2 E 2 E 2 2 E 8 E 4 X 1 E 2 1 E 3 E 3 E 3 E 3 E 3 E 3 E 3 E 3 E 3 E 3 E 4 E 4 E 4 E 4 E 4 E 5 E 5 X 5 E 5 E 5 E 3 E 3 E 3 E 3 E 3 E 1 XI 58 E 1 XI 1 XI 1 XI 10 10 10 10 10 6 E 7 X 6 E 6 E 6 E 8 E 8 E 8 E 8 E 8 E 5 E 4 X 5 E 5 E 5 E 12 X 62 E 60 E 12 X 12 X 8 E 8 E 8 E 8 E 8 E 6 E 13 X 6 E 6 E 6 E 7 E 7 E 7 E 7 E 7 E 18 18 16 18 18 9 E . 9 E 9 E 9 E 9 E 10 E 10 E. 10 E 21 FB 10 E 8 E 8 E 8 E 8 E 8 E 11 E 11 E 11 E 11 E 11 E 8 E 8 E 8 E 8 E 8 E 8 E 21 X 1 E 2 1 E 8 E 21 X 1 E 2 1 E 8 E 21 X 1 E 2 1 E 14 58 E 1 XI 1 XI 1 XI 15 E 15 E 15 E 29 FB 15 E 8 E 8 E 8 E 8 E 8 E 6 R FD 7 R FD 8 R FD 9 R FD 10 R FD 81 NOUL CHmRHCILR LLHSbEb-* ** 11 (*) 12 (/) 13 m 14 (;) 15 12 15 57 E 56 E 17 1 1 E 1 E 57 E 56 E 28 P 2 2 E 2 E 57 E * 2 E 28 P 3 1 E 1 E 57 E 56 E 28 P 4 3 E 3 E 57 E 3 E 28 P 5 3 E 3 E 57 E 3 E 28 P 6 4 E 4 E 57 E 4 E 28 P 7 5 E 5 E 57 E 56 E 28 P 8 3 E 3 E 57 E 3 E 28 P 9 1 XI 1 XI 57 E 56 E 9 10 10 10 10 10 20 11 6 E 6 E 57 E 56 E 28 P 12 56 E 8 E 57 E 8 E 28 P 13 5 E 5 E 57 E 5 E 28 P 14 60 E 60 E 57 E 61 E 28 P 15 8 E 8 E 57 E 8 E 28 P 16 6 E 6 E 57 E 56 E 28 P 17 18 7 E 7 E 7 E 59 E 18 18 18 18 18 1 XI 19 9 E 9 E 57 E 9 E 59 E 20 10 E 10 E 10 E 10 E 59 E 21 8 E 8 E 8 E 8 E 59 E 22 11 E 11 E 11 E 11 E 63 E 23 8 E 8 E 57 E 8 E 28 P 24 1 E 1 E 57 E 56 E 28 P 25 1 E 1 E 57 E 56 E 28 P 26 1 E 1 E 57 E 56 E 28 P 27 1 XI 1 XI 57 E 56 E 9 28 3 R 15 E 15 E 15 E 59 E 29 8 E 8 E 8 E 8 E 59 E 30 11 R 12 R 57 E 14 R 63 E 82 NODE CHnRhULK UL .RSSE b+ 44 16 ( 17 ( ie (P) (I) 20 (C) 19 24 1 1 1 1 i 1 1 1 2 2 2 1 , 1 1 3 3 3 1 1 1 4 59 E 4 3 E 3 E 3 E 5 59 E 5 3 E 3 E 3 E 6 59 E 6 4 E 4 E 4 E 7 59 E 7 5 E 5 E ■ 5 E 8 59 E 8 3 E 3 E 3 E 9 9 9 1 XI 1 XI 1 XI 10 59 E 10 . 10 10 10 11 59 E 11 6 E 6 E 6 E 12 59 E 12 8 E • 8 E 8 E 13 59 E 13 5 E 5 E 5 E 14 59 E 14 12 X 12 X 12 X 15 59 E 15 8 E 8 E 8 E 16 59 E 16 6 E 6 E 6 E 17 59 E 59 E 7 E 7 E 7 E 18 18 18 18 18 18 19 59 E 59 E 1 Fl 1 Fl 1 Fl 20 59 E 59 E 10 E 10 E 10 E 21 21 22 8 E 8 E 8 E 22 59 E 22 11 E 11 E 11 E 23 23 23 8 E 8 E 8 E 24 59 E 24 1 25 1 25 59 E 25 1 1 26 26 59 E 26 1 1 1 27 9 27 1 XI 1 XI 1 XI 28 59 E 59 E 15 E 15 E 15 E 29 29 30 8 E 8 E 8 E 30 59 E 30 18 R FD 19 R FD 20 R FD B.1.6 Safe nodes 83 «u ■o • c s V <+■* id _i0 10 id 10 -8 0> c 4-» s (0 c (0 £ 10 0« -• 10 ■ s -M 10 10 •-• <♦«. +» c 0> 3 — X o» —•-MM 01 — ~i 01 u (0 jo o o x 10 c o o» c c T? —. _p J_ "0 0J 01 o <0 "D J. •- o ;< id oi — -J a u C£ U 10 •d ^i c 10 ro 4J ~ P--0 0' IT1 10 m id — 10 jD id P X -p L •-. Oi 3 10 3 OJ OJ -H 01 a.' -p 3 7? id a o -P 10 75 75 Q.J v p qj .d <•- c M J- •-< u) 4-' 0' 01 51 0' OJ o» X X! •P (0 U -P •r-« c 10 OJ ^ x c -p id o» 2 .0 2 ° 3 &0 c 3 •- • L 10 4-» 41 ™ o id -M = o . OJ o» (0 o = o X X -♦-» 3 — id -*-> o a oj ,:\ (0 h- 3 84 B.1.7 Predefined symbols > .0 XC r )COC r )(NJC r )'*"m , * p,, - COON ' s *'"* t- « u _i o U U -J 0»- , -*-«<\ICM(\IC\l<\|Csl(n 86 > \/ JSj is) S) £3 ^3 ^5 ^) ts> C3 S) &) ^ C^ ^3 &5 S( ^CMfVJCOCsJtMtSICOCOCOtSJCltNJCMCslCMfSI O J CL to in (0( , )(^nc^(oc)f , )1■T1■1■1■1■^■ , }■ Q U h- E £ *-t Z 2 O Ql Q O Z u LD Z l-H Ld Q O q: a: Z Z o u Urn L. h- CL O > Z Ul L_ H > U CK n O ID CE S)fi)i3S(Si(5(5i3!A!S)iSS|QE|(S(S| \/ t^ (^ Sj 6q Bj 6q Qq 0} St 6| tSj Kj &j Si 6} 68 CM&acMmmmmminincsir^rosOvOso COCOCOCMCMCMCMCSICMCMCO Q. OO O* ep ,-! CM CO t in \D r^ CD C7> CT> S) *- • •*- < I/) 4J *■ t in LA in in in in in in in in in SO vO vO fc- 0) tf J in vD in H (J Z 52 z t-n U LO CO '0 j— D Id _l n z to U Ld LO U Z — • Cm v^ jb t^ cs cq &q ^ ^ Cq Csp Sj &q ^ &q ^ £^ 6b 73 iT , NLr'i5S)S)SS)iSS3S!!S , - | *- | ' H »■* Q.IS N^OOOOGDOOOONSNIANNNN m e Q U n Ld HKQ.QH U h U U H E U 01 (HhUXEI-QO u I- Q_ U QUO) > o 21 ZZOC ■hCCQUZCUHUULJ 89 •— is (SQ CS5 CQ &S) (5) S3 ^" fiQ &) Q) CnI (5) O* "^ O"* t *-«tS}53S5£)O&lSQ&!&lCS3fc3<£>00CQ0000 o ^C5tS5S)CS5(5lSCS5fiS)t3iS)tS)iSjtS)S3^tS) U)4 J NNN0D0O(DCO(D0O(D0OCDCOa>^a> O L U m o: u VVH Z H L. Q Q. H H £ £ n z z .XQi<[OlDHQ H XOeLyULJHDaZQCQ • liJOOZQ.K(n(/)3COZ n en v /s — 4 J CO0DCDCD(DCOCO0OCOCr>Cr>CT*CT>Cr*CT>a* 90 *•* •■* tfl co ^" ^CMVC0C9S)l/>S)^^" C N N (J^ 0> •— < --< «-* vo bs) ts r^ t») &) «-» <^, _ _ _ _ o s/ ^q £55 ^5 ^3 C3 ^ ^Q ^ ^5 GQ ^3 ^Sj ^Q ^Q 73 in u\ fl^o^o^sssssffiifl } s __,_,^.^,_,__cr)cr).^rr,(r),_ CL S- 10 -M o > U Ld H H HH (Q m h- J h H a: a: ^ os cr» C )tS)tqi9~* 91 B.l. 8 Field token: Fields are special predefined, non-printable tokens which may be used to pass position information to syna: Field 1 2 3 Name Table Index 8 23 Press ' 1 ' , ' 2 ' , or ' 3 ' to change any of these Press (back] to return to index page. i B.1.9 New symbol allocation classes 92 ,c tD u it) • V ■ *4 . — < • JC < M 2 3 *-+ 05 u •— • 4-» iD -4-> • • id 2 ■-4 4-' 73 DO ill «0 •V E 4-> _o -p ID -«-« c •^H ZJ C 73 X •r+ u 10 iD 01 <0 >v >V-0 •— 1 +> 73 f iD M c w XI C c- 0> P •0 <0 _£ O fca y-^k -+J u • ■-• u. — • ID c 4-> A-> • JD +» ^ ^ III ^: «o 1 ^ 4-> - o a< (i M. J- 6 o 7? 0.0 ^- — • W-* =J •— t •—* u) — • V C — jQ Si j^ >—* - r-« _3 73 -t-l r-^ iS< "" <>J CO T IA T T u^ u"» u"> u^ u"> ir> t5tfet|i5}C5l'.S)C3C5l3S! I I I I I I I I 15 h W O t IA >0 N CSjC^C^C^C^C^C^iS) I I I I I I I I C'COtlftiONCOON ro co co co co co co co C3 CS C5 CSJ CS) t5 CSj 'S( •• I ! — I I I I I I Q.J t IA \D N (D OjiSj h — ■ (M CM (M N CM CM CO n ■0 -pcsjcsicsjcgcsicsicsicst C 1 1 1 1 1 1 1 1 0.0 c <0 ^: o 4-> m £ 3 C ID ID 10 •—> O <0 a ID 01 'S) CS) CS> CS) CS) CS> C5 O N 93 B.2 Picture tables Press. . . To change. . . ! • a t Name of langauge (COBOL) b ; Name of character set (COBOL in trw2) c Editor leslist index <15>: (cobolcomp) d Interpreter leslist index <3>: (trw2) e Internal character codes (6 4 codes) f Blank code (1) g Default tabs h Key Funct i on Tab 1 es i Lexical Class Assignments (20 classes), - j Lexical Node Table (31 nodes) k Safe Nodes 1 1 Predefined Symbols (109 names, 574 characters) m Field Symbols n New Symbol Al location Classes flSi&BftCK] to return tables to -trw6- B.2.1 Lexical character classes 94 VJ 1 1 1 1 1 1 CJ U. Ld Q CJ 1 I I \ r Q_ «3 \f + -e- 1 1 NnTlA'ONODITilSJ^NnflAvDN . CM in (J U co «t» (J V CO ca O ^o cm <■ CJ (J CO CD CJ t" cm OS (J vO — CO (J (J co r>- U T - CO (J \D —•cm CJ (J CO vO U ^r csj r^ CJ so — - U (J co in ^r o \D (J m hS! CJ (J co *■ CJ "T CO in (J in — CJv U CJ CM CO (J t fs -r (J in H 00 (J (J CM C\l (J "T iD CO (J in — f^- (J U M ^ (j «r in cm (j m ,-H lO (J CJ CM £j vO - . CJ "^" "^ °>Cr U -* CJ m — in CJ >- in CJ cm o> CJ CJ co co 3 *a u m T — t CJ 3 CJ CJ CM CD CJ 00 CM F— co os . CJ in CJ CJ co CJ CM CO CJ CO *-• O" CJ CJ CJ in cm CJ — r>. cm vo CJ CJ U co eg CJ in ^r • • 1 ... co os 15 — «-• CM (J 95 B.2.2 Lexical node table . 1. 1 JUL i_ LI ii ii'.i i'- 1 l_i\ LLI lL'_-L. i -f il 1 (X) 2 (0 3 (.) 4 (1) 5 0) '■0- 32 E 2 P 11 X 32 E 32 E 1 1 2 P ' 1 X i9 E 19 E 2 4 E 4 E 4 E 3 4 E 3 12 E 12 E 12 E 3 18 R 4 20 E 2 P 20 E 20 E 20 E 5 21 E 2 P 21 E 21 E 21 E 6 22 E 2 P 22 E 22 E 22 E 7 23 E 2 P 6 X 23 E 23 E 8 24 E 2 P 6 X 24 E 24 E 9 25 E 2 P 2 X 25 E 25 E 1 10 26 E 2 P 6 X 26 E 26 E 11 27 E 2 P • 2 X 27 E 27 E 12 34 E 34 E 6 X 34 E 34 E 13 35 E 35 E 6 X . 35 E 35 E 14 36 E 36 E 2 X 36 E 36 E 15 37 E 37 E 6 X 37 E 37 E 16 33 E 33 E 2 X 33 E 33 E 17 39 E 39 E 29 E 39 E 39 E 18 28 E 2 P 14 X 28 E 28 E 19 29 E 2 P 14 X 29 E 29 E 20 30 E 2 P 10 X 30 E 30 E 21 31 E 2 P 14 X 31 E 31 E 22 32 E 2 P 10 X 32 E 32 E 23 27 E 2 P 3 X 27 E 27 E 24 33 E 33 E 3 X 33 E 33 E ' 25 39 E 39 E 39 E 39 E 39 E 26 1 51 E 26 51 E 51 E 27 40 E 40 E 40 E 40 E 40 E 28 41 E 2 P 3 X 41 E 41 E 29 42 E 42 E 3 X 42 E 42 E 30 43 E 2 P 11 X 43 E 43 E 31 38 E 38 E 3 X 38 E 88 E 96 NULt : chmKhl ILK LLM._oEbH ► li 6 (-) 7 ($) 8 (*) 9 (Z) 10 c,) 32 E 32 E 32 E 32 E 22 1 19 E 19 E 19 E 19 E 54 E 2 4 E 4 E 4 E 4 E 4 E 3 12 E 12 E 12 E 12 E 12 E 4 7 5 9 10 6 5 21 E 8 9 10 6 6 22 E 22 E 9 10 6 7 7 23 E 23 E 23 E 7 8 24 E 8 24 E 24 E 8 9 25 E 25 E 9 25 E 9 10 26 E 26 E 26 E 10 10 11 27 E 27 E 27 E 27 E 11 12 18 34 E 34 E 34 E 12 13 35 E 19 35 E 35 E 13 M 36 E 36 E 20 36 E 14 15 37 E 37 E 37 E 21 15 16 33 E 33 E 33 E 33 E 16 17 39 E 39 E 20 21 17 18 18 28 E 28 E 28 E 18 19 29 E 19 29 E 29 E 19 20 30 E 30 E 20 30 E 20 21 31 E 31 E . 31 E 21 21 22 32 E 32 E 32 E 32 E 22 23 27 E 27 E 27 E 27 E 11 24 33 E 33 E 33 E 33 E 16 25 39 E 39 E 20 21 17 26 4 5 9 10 6 27 40 E 40 E 40 E 40 E 40 E 28 41 E 41 E 41 E 41 E 41 E 29 42 E 42 E 42 E 42 E 42 E 30 43 E 43 E 43 E 43 E 43 E 31 | 38 E 38 E 38 E 38 E 16 97 CHiiKHL I'ER CLRbSLS-* 11 (S) 12 (9) 13 32 (V) 14 (.) 15 (0) 32 E E 11 X 22 19 E 54 E 19 E 1 X 54 E 4 E 3 4 E ' 4 E 2 12 E 3 12 E 12 E 3 20 E 17 17 6 21 E 17 17 6 22 E 17 17 6 23 E 12 12 7 24 E 13 13 8 25 E 14 14 9 26 E 15 15 10 27 E 1 1 ' 16 16 11 34 E 22 34 E- 6 X 12 35 E 22 35 E 6 X 13 36 E 22 36 E 2 X 14 37 E 22 37 E 6 X 15 33 E 22 33 E 2 X 16 39 E 22 29 E 39 E 17 23 E 28 E 28 E 14 X 18 29 E 29 E 29 E 14 X 19 30 E 30 E 30 E 10 X 20 31 E 31 E 31 E 14 X 21 32 E 22 32 E 10 X 22 27 E 23 24 31 11 33 E 33 E 3 X 22 j 39 E 39 E 39 E ■ 17 27 23 25 17 6 40 E 23 29 40 E 40 E 41 E 28 29 3 X 41 E 42 E 30 42 E 3 X 42 E 43 E 30 43 E 1 1 X 43 E 38 E 22 38 E 38 E 16 98 N'.'L !_ 1 2 3 4 5 6 7 6 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 LI ii u\i •'- ILI- '■ U I-' 16 (♦) 17 (*) 18 ( 19 20 ( 32 E 53 E 52 E 54 E 53 E 1 52 E 1 4 E 53 E 59 E 52 E 2 12 E 53 E 59 E 52 E 3 20 E 53 E 7 52 E 4 21 E 53 E 8 52 E 5 22 E 53 E 6 52 E 6 23 E 53 E 7 52 E 7 24 E 53 E 8 52 E 8 25 E 53 E 9 52 E 9 26 E 53 E 10 52 E 10 27 E 53 E • 11 52 E 11 34 E 53 E 59 E 52 E 12 35 E 53 E 59 L" 52 E 13 36 E 53 E 59 E 52 E 14 37 E 53 E 59 E 52 E 15 33 E 53 E 59 E 52 E 16 39 E 53 E 59 E 52 E 17 28 E 53 E 18 52 E 18 29 E 53 E 19 52 E 19 30 E 53 E 20 52 E 20 31 E 53 E 21 52 E 21 32 E 53 E 22 52 E 22 27 E 53 E 23 52 E 23 33 E 53 E 59 E 52 E 24 39 E 53 E 59 E 52 E 25 56 E 53 E 59 E 26 26 40 E 53 E 59 E 52 E 27 41 E 53 E 28 52 E 28 42 E 53 E 59 E 52 E 29 43 E 53 E 30 52 E 30 33 E 53 E 5 9 E 52 E 31 B. 2. 3 Safe nodes 99 iO V - •. 75 * c t, t &0 •— « u 4-» <•-• C C 10 c 4-- j_ +< -P -H •-^ 3 ("Pi IQI U~* 1 cr I •— • juij toj ^ IrJ •-4 <0 II 4-». ■ w-t -M 0) -•-i 73 • «-• - #•* u c Hi V •d • »-• * 4-> d _i CL 1i M i^ o X c £ V 4-" , iO ■o J- 4-' J- TS V 10 4-> 4-' OJ 4-' 'i' 10 J- • <-< •—» £ T? 4-' rd 4-» id s: V a to u ••H 75 • »-« • »-• 0_ 01 ^1 ^1 >s 10 4-» 4-» 3 H d 100 APPENDIX C OTHER DOCUMENTATION Supplementary documentation for the COBOL system, produced by auxiliary programs, is included in this appendix. Only a sample of the transition diagrams is included, since they include the same information as presented in the lexical node tables. 101 C.l Transition diagram sample • Trans it 1 on D 1 agram •. Generator To display lexical transition diagrams for use' with tables of the Computer Assisted Programming System. 102 O © Explanation of Symbols 1 ex i ca 1 node number procedure ca 1 1 • error message number syntactic class of an accepted token lexical character class returned by subroutine { } character class number, then first 5 class members N Non-extendible token X extendible token I Ignore token (do not send to parser) Fr\ Generate field *n (1,2, or 3) FP Field starts with next column FB Field begins with current column FE Field ends with current column . FD Field ends with previous column Cn Column *n 103 Node 0: ^ v w [2} ( {3} {i^} (12) 9 {M} . {15} {13} {20} C.7 {1} X {4} 1 ? 3 4 5 {5} ) {6} - Y-p 1 IX 22 © 1 IX '22 <7) ./' v x ^ /N ?P 7} $ 18) » {9} Z {11} S {13} V {16} + ; ft P {17} $ < I & ! {19} Cl b* & '3 2 •# ^ 104 C.2 Flowchart of "cobolrun" "cobo Irian" ■ flowchart Except for the units of "trw" used by cobolrun, each unit of "cobolrun" appears on at least one page of this lesson. If it appears on more than 1 page, its "home" page (the one you get by typing TERM unit -name) is the highest numbered -page that - it appears on. The flowcharts are arranged by pages according to their cal 1 ing sequences. This means that the called unit never appears. on a lower -numbered page than the calling unit (a "call" may be a TUTOR do, join or goto) . , 105 PRGE 1 texec:=>u.p x 1 oad Rdd Red • i n i t i me Cls Stp xpage 1 If Wrt 1 I ■ .. msgwrite Cmp Err edbeg i n Els Branch m_ i n i t Mov Pfm 2 » i i ' Ei nit Ext datadiv Go boxer Opn scan • Nxt • € Pfm i Pfm Err • Nxt scan address • Dvalu e Pfm2 106 PfiGE 2 Pfm2 boxer scan address • Ma n i p Barith Cond i t Branch 107 PAGE 3 Ext/Nxt scan Els scan Go 5Cd.n c_rr address Dvalu Branch 108 PAGE 4 Add scan address < Barith Kc 1 ear Cmp scan address Expres 109 PAGE 6 Nov scan address Manip Opn scan Err no • PAGE 7 Ill Wrt : scan - Err •< ■ address Dva 1 u. Pwrte Stp rnsgwrite screen PAGE 8 Cls scan Err Pwrte 112 Red ■„ scan Err PAGE 9 rnsgutr i i-t= Showtk stopclk , 1 strtclk Wherat Rechlp , rnsgwrite M ■ riicr o 113 M i cro • Uherat Showtk * stopclk strtclk Readh 1 p screen : msgwrite -. PAGE 10 datadiv scan address Man i p edbox 114 PRGE 11 115 If • ■ Cond i t 1 Expres Resu 1 t boxer scan PfiGE 13 scan boxer • 116 Expres ; scan '• » ■o 1 . address • Err Mach i n Barith Lnot *^. • Cnumer E Man i p , . t PAGE 14 117 address • Dva 1 a . scan address Err Errend e Stp2 PAGE 15 >topclk strtclk Choose rnsswrite edbox Stp xpage 1 118 boxer PRGE 16 stopclk strtclk x 1 oad i load edbeg i n scan 119 PAGE 17 120 Manip Dmove Dcompr Barith Crnove Ccompr Show PAGE 19 121 Barith t Dva. 1 u \ • • Bsca 1 * E di no w> Err Show Errend Ddec PAGE 20 Dvalu Derror Err Errend Show E 122 PAGE 21 123 Ddec : • i • i 1 Dsize .. • Err • . i ; 1 Errend . '. Edigit 1 Emove , -. Eresult i • Epic Edigit . E Stp2 i PAGE 22 124 Dmove * ' ; Show ' • Wherat ', • msgwrite stopclk strtclk i Showtk Sign / T'^.4- -- 1 ^CL_ a 1 PRGE 23 Dcompr Sign Get_< Derror Err 125 Err : Showtk Stp stopclk strtclk • i Subhe 1 p • Showtk Errend msgwrite PRGE 24 126 Stp msgwrite Stats rnsgwrite Stp2 z 1 oad page 2 PRGE 25 12 7 xpage 1 . • •* \ msgwrite • * 1 stopclk i 1 strtclk • screen d i sp 1 ay • dspl ine tableau Helpl : msgwrite . stopclk - <= +• >^4- — 1 1 • strt wlK PRGE 26 C. 3 Mode table diagram 128 NO : ill ega 1 move or compare ; DEC : dec i ma 1 mode CHR: character mode; BIN: binary mode move cmpr TO 0M N GR GR RN NE XL BI ED ZR NL f\H NE XL BI ED ZR \IL CHR CHR CHR NO CHR CHR NO NO CHR CHR CHR CHR NO CHR CHR CHR CHR CHR BIN NO NO DEC NO NO CHR CHR CHR CHR NO CHR CHR CHR CHR CHR NO NO NO NO NO NO -CHR CHR CHR CHR NO CHR CHR CHR CHR CHR NO NO NO NO NO NO CHR CHR CHR NO NO CHR NO NO CHR NO BIN NO i BIN BIN HO [•JO NO NO NO NO BIN BIN BIN BIN CHR CHR BIN NO BIN DEC NO NO CHR CHR CHR CHR BIN DEC DEC DEC CHR CHR BIN NO BIN DEC NO NO CHR CHR CHR NO BIN DEC NO NO HO NO BIN NO BIN DEC NO NO CHR CHR CHR NO BIN DEC NO NO 129 APPENDIX D SAMPLE COBOL PROGRAM In this appendix several displays that might be seen by the student as he uses the COBOL system are shown, This is far from a complete set; the student may also see error messages, "help" information in the interpreter and the information contained in appendix A. U 130 E- Qi q z: u u n h- h- CO Qf u o_ »-i u h- E01OL0 o i.o Q: > uazo.tr i.O -P ■-. to ,£ i- 4J -,-. U-, V 10 J- 3 3 X 4-» U) 3 — ■ Xi -M • *t * *— ■ ^* ^^ •»-« C c Wi *»■■ 'U • ■-• u") _Q 10 10 C 10 V O -~ ~* -M — ,c -M 4-» 10 . P~l rH j ClJ 1 3 "S l~ i- 1J +» 4-» ^ fa?| "— ' -I UJ IxJ ■ C . - - lO 10 10 o^ I- W W < • cr. cr> *-» ft ft I • > > Z - - - . — \ s-\ *— \ O y-\ y-^w /-^ IT> vD vD " UJ CO. GO •_/ -\_-- ^^ tn \-^ 'w >^ O 0> (^ Q ft § I • • • QL • • • u u u o u o u H H H (J H H H Q_ Q_ Q_ U Q_ Q_ Q. q: • ■ _l Ld • I U 03 > Q\ CT» OS Os > > vO NO ^^ x—' CT> Os CD CO U L) n l-l Q_ 0. o-» n (E i k> crOL^casjcQta CO u u en u CD o u u n Z Q Ld 3 Ld Q U (T © Z • LL Id O i i u O d E O Z h- i i CJ 3 3 cr • • CY Ld h- 3 CY 3 a &. q: Ld LJ LJ UZQ o Ld _i N N g l-H cr CO • • -. • Ld 3 Ld 3 a! _i i Q .„ . • • • ■ _l a! CO > 5 i 3 i cr H • • \~ 4ft 4ft 1 on ON 0. U • H ON on h- 4ft 4ft 1 ON ON _i _l z + l-H ON CT» l-H 4ft 4ft 1 > > b Z ». «k m /-" \ ,-x O CO CO 3 . _i o _ v ^^ ^ o <^\ ^^ ^^. •Jj vO 1 _£ mD vD uj 00 oo 'w' -w Ld a Hj Z CO CO N_^ >— ' w CO >-• >_• \-- ' ON ON _j _i U o • _j i Q o ON CT> O 4ft 4ft 1 CO CO M Q O ■p* or T? a: 3 OT 6% • L. Z i i L_ 3 CO Ld O U u (J O u O (J i Ld CO co or i z u »— i HH n U >-H l-H l-l l-H HH 1- _l Q i Ld CL 0_ Q_ U CL 0_ 0. ■■ CL 0- Z Ld O o cr o_ _J 3 OT ; Or ■ 3 _J H- h- CO a O -■ . t -J ■ - • _l d" : g O n U L 1 _J i a co _L " U • Ld qd H z co CO HH n or Ld Q 3 U j— i or U Q 3 HH z a u Ld h- h- _J Ld t j- Z O 0") Ld • 2 Q o _l Ld Q Ld CL" > CQ hH O Ld or y ~3 i i i U ■ 1 i \- CO o j? CL Ld O 8 3 or I 1- 3 3 " • • Q Z y u co CD co OC 1 CO CO z O co CO Q or ran Q O o CM CM J> ^ -J J cr cr co co i. i a 3 _l Ld o z I I 3.3 135 COBOL EXECUTION STATISTICS Variable Storage Used: % of Storage Used: Statements Executed: i Lines Out put ted: Tot a 1 Execut ion Time: 76 characters 4 % . ■ 22 1 0.9 47 seconds Average T i me/st at ement : 0.0430 seconds Average Statements/second: 23.2 136 APPENDIX E PROGRAM LISTINGS In order to reduce the size of the report version of this thesis, the program listings included in Appendix E of the original thesis have been excluded. BLIOGRAPHIC DATA EET Title .ind Subtitle I. Report No. UIUCDCS-R-7 5-6 85 AN INTERACTIVE COBOL SYSTEM FOR PLATO 3. Recipient's Accession No. 5. Report Date January , 19 75 6. \uthor(s ) Robert D. Barnett 3 erforming Organization Name and Address University of Illinois at Urbana-Champaign Department of Computer Science Urbana, Illinois 61801 Sponsoring Organization Name and Address University of Illinois at Urbana-Champaign Department of Computer Science Urbana, Illinois 61801 8. Performing Organization Rept. No. 10. Project/Task/Work Unit No. 11. Contract/Grant No. 13. Type of Report & Period Covered M.S. Thesis - 197 5 i TZ ~~ — Supplementary Notes Abstracts An interactive COBOL compiler system for the PLATO computer- based education system is described. The system has two major components: an editor and an interpreter. The editor uses language-independent routines developed for PLATO, driven by tables. The interpreter acts on a representation of the COBOL program to execute the procedural statements. An explanation of the implemented COBOL subset is inning e\ Words and Document Analysis. 17a. Descriptors ' Computing Reviews categories 3.51, 4.13 and 4.22 C0B0L Interpreter routines Compilers Man machine systems Diagnostic routines '• Jentifiers, Open-Ended Terms Computer assisted instruction Data processing training OSATI Field/Group ■""liability Statement Release unlimited ' M TIS-35 ( 10-70) 19. Security Class (This Report) UNCLASSIFIED 20. Security Class (This Page UNCLASSIFIED J r»f Pages 140 22. Price USCOMM-DC 40329-P) I IMmmmMm mm ■SvOF.LL.NO.S-UHB*NA p,o 9 r«m m«nu«l NOH n«™ BnhhhS wocfffinMHtr Srama HSh 3m9HHH BhMBhH h HHflflH iSHfl Hffitt&flHfiBHH^U Hi Hi HI MB H HH ■ i 19 81 SSS wXBBB nn