EOL-2(ID:4638/eol003)Expression Oriented LanguageVersion 2 of EOL Related languages
References: The development of the EOL language started two years ago at the Institute of Mathematical Machines in Warsaw. The initial EOL-1 version was then elaborated and it permitted many experiments to be carried out. On this basis an improved but as yet unimplemented EOL-2 version has been developed which is the subject of the present paper. Extract: Data Structure Data Structure In the EOL language the syntax is defined not only for the program, but also for input and output data and for intermediary results such as expression or files. 2.1. Input and output data are represented in the form of strings of arbitrary characters. Up to 32 input strings can be distinguished by means of the variables II,12,.,.,132. Similarly, up to 32 output strings can be distinguished by means of variables Q1,Q2,...,Q32. To illustrate values of strings denoted by variables I or Q we write for example 18 : ABCD Q7 ; RESULT X=l ; The above notation is intended exclusively for illustration purposes, and it is neither a part of a program nor serves to determine the data. The input data are read by EOL instructions character by character, so that each time, the first character of the indicated string is read and simultaneously deleted from this string. The output data are written by adding new characters at the end of the indicated output string. Assembling the input characters into symbols or detecting a specified character pattern is done by a program. Due to this, input and output data may have any form, the most convenient for the given problem. 2.2. Expressions The input data are used by the program to build linear lists such as expressions or files. Up to 32 various expressions can be distinguished in a program. The expressions are denoted by the variables E1,E2, ...,E32. In order to illstrate a value of some expressions we write for example El : "XA°3°8AP11 E5:"TO'BE'OR NOT'TO'BE E3 : "Y"="A1'*"CB"+'ALFA"*"X") Expressions are lists composed of constituents, formed of one of the marks ~ or ° or A, followed by a string of characters. The marks determine the structure of the list inside the computer. They do not appear in input or output strings. The constituents are divided into words, numbers and record addresses. a) A word consists of a string of arbitrary characters, preceded by the mark ". Usually a word constitutes an independent component of the text. b) A number is a freely chosen string of digits, possibly with an algebraic sign, and preceded by the mark °. Numbers in the EOL language permit one to perform operations on integers. c) The address of the record is composed of a string of any characters preceded by the mark A. These addresses serve to a store positions of the records in files. In the EOL programs there are many instructions enabling flexible processing of expressions, for example: a) Moving a determined number of constituents from the beginning of one expression to the beginning or to the end of another expression, the original order being kept or reversed. In a special case, every variable E may play the role of the so-called stack. This property significantly facilitates the forming of recursive procedures. b) Compressing several words into one word or splitting one word into separate characters. c) Testing whether the initial or the final constituent equals a fixed word or number, or belongs to a specified class of constituents, for in stance whether it is a letter. d) Searching for a given word or for a specified string of words in an expression. In the EOL programs the majority of operations handling not very great amounts of information are performed most frequently by means of expression processing. Expressions are implemented as linked pairs of words. Storage allocation of expressions including retrieval of abandoned cells for reuse is done automatically. 2.3. Files Up to 32 various files can be distinguished by means of variables P1.P2,... ,P32. Each of the files represents a list composed of any number of records. In order to illustrate the value of a file, we write for example P3 : vavbvcvcrvd t vevf Small latin letters denote formerly described expressions. Every record in a file consists of a mark v followed by an expression or by one of the following symbols: a - symbol, denoting the beginning or the end of a section in a file. jn - sorting symbol. This symbol written in the file causes a sorting operation on a file segment between this symbol and the nearest symbol cr or the end of the file. T - a pointer which serves to indicate a distinguished place in the file. In every file there is exactly one such pointer. Reading of or writing a file always concerns the record which follows directly after the pointer. In the EOL language there are many instructions which permit one to process files, for example: a) Shifting the pointer forward until it comes across the record that satis fies a specified condition. b) Storing the address of the record, placed directly after the pointer, as the initial constituent of an indicated expression. c) Placing the pointer before the record, the address of which is the ini tial constituent of an indicated expression. The last two operations permit one to manipulate addresses of records by means of instructions designed to process expressions. This enables one to determine freely the file structure, this facility being very important in many applications. For example, the EOL language often permits one to form files having a structure which allows an effective searching of information written in this file. The files are designed to store a large amount of information, for example to form tables for translation from one artificial language to another. Files are implemented as linked blocks, each block corresponding to one record. For storing files, a secondary storage can be used. Extract: Programs Programs The programs written in the EOL language consist of instructions and declarations. Instructions cause the execution of some simple operations, such as changing of list values or interrupting a normal sequence of program execution. The structure of EOL instructions is very simple. They are similar in spirit to computer instructions, but they serve for manipulating strings. An example of a procedure, written in EOL language, is given below. ELEMENT : PROC CLEAR II, LDR /*CLEAR INITIAL BLANKS*/ EQ II, LD /* IS THE INITIAL CHARACTER ALPHANUMERIC?*/ GOPL LI /*YES, GO TO LI*/ READ II, Z3, 1 /* READ ONE CHARACTER*/ RETURN LI : READ II, Z3, RD /*READ STRING OF LETTERS AND DIGITS*/ RETURN END The task of this procedure is to read a subsequent element of an arithmetic formula written as input string II. In the formula, either an arithmetic operator or an arbitrary string composed of letters and digits is considered as the formula element. This element is added as a separate constituent at the end of the expression E3. Blanks preceding an arbitrary element of the formula are removed. The first line contains the heading of the procedure, last line indicates its end. Inside the procedure on the left side the instructions are written and on the right side - comments. Every instruction consists of a key word like CLEAR, EQ, or READ which is followed by not more than three arguments. These arguments often consists of a letter with an index, i.g., II, Z3. The letter specifies more exactly the way of the execution of the instruction. The index determines the string, expression or file to be operated on. Every EOL instruction is represented in the Polish ZAM computer as a 24-bit word. These words are read one after another by the program called Interpreter, which depending on computer word content causes execution of one of the EOL instructions. The structure of procedures in the EOL language is similar to that of the PL/I language, which permits a block nesting and an independent definition and compilation of external procedures forming one program. Extract: Program Modification Program Modification Programs, and thus all EOL procedures written in their final form are always related to variables I, Q, E or P, with fixed indexes of a narrow range from 1 to 32. Operations on these indexes or their modification during the program execution are not included in the EOL language. Therefore, substituting parameters in procedures while executing the program is not possible. This enables a significant simplification of EOL implementation. On the other hand, these limitations create some difficulties while writing programs. For instance, a small number of variables requires a careful selection of their indexes. This can be inconvenient in bigger programs, where for instance, some variables should be common for several procedures. In order to lessen these inconveniences a method has been adopted for automatic program modification before its execution. This method is based on the well-known idea of macro-definitions which are then included in the program by means of macro-instructions. The procedures can be initially written in the source program as macro-definitions, in which the chosen indexes are written as formal parameters in the form of identifiers. These procedures can be included in the object program by means of macro-instructions, which assign actual numerical values to these identifiers. Due to this, fixed values of indexes can be established by the programmer at the moment of assembling several procedures into one program. The accepted method of program modification permits us to write the procedures with symbolic indexes. However, while writing the final program the programmer is charged with some additional operations which, in practice, are not too burdensome. At these costs, the EOL language could be significantly simplified and the efficiency of its operation increased as compared with languages in which the writing of programs is easier. Extract: EOL Language Extension EOL Language Extension EOL is a universal but relatively concise language, designed with only a basic set of instructions for symbol manipulation. More complex operations can be defined as procedures. However, in many applications the execution time of such procedures can be rather long. In order to make them more efficient, the EOL procedures can be also written in machine language. As a rule they are based on the data structure accepted in EOL, and use the Interpreter subroutines. Thus, these procedures may be treated as EOL language extensions defining specialized operations, tailored to a given problem. The EOL procedure written in machine language are often first written and debugged in EOL language and then translated into machine language by a programmer being familiar with the Interpreter and the EOL data structure. This system permits one to obtain a full program documentation in EOL language and possibly to perform it in another computer, equipped with the EOL Interpreter. Extract: Conclusions Conclusions EOL is a simple low-level symbol manipulation language, relatively efficient, flexible and easy to implement. These results have been made possible by the following features of this language: a) Arbitrary input or output strings, including control characters. b) Separate devices, including storage allocation methods, for processing short but complex expressions and for processing files containing a great deal of information. c) Simple format of instructions and the possibility of defining more complex operations by means of procedures which can be written also in machine language. d) Possibility of automatic program modification before its execution. The experiments conducted so far indicate EOL usefulness, especially for translating from one automatic programming language to another. in Bobrow, D. G. (ed) "Symbol Manipulation Languages and Techniques", Proceedings of the IFIP Working Conference on Symbol Manipulation Languages. North-Holland Publishing Co., Amsterdam, 1968 view details |