A Descriptive Language for Symbol Manipulation

The algebraic command languages (ALGOL, IT, FORTRAN, UNICODE), although useful in preparing numerical algorithms, have not in the author's opinion proven themselves useful for symbol manipulation algorithms, particularly compilers. List processors, in fact, have been designed primarily to fill this gap. Analogously, the traditional flowchart serves well as a descriptive language for numerical algorithms, but does not lend itself to description of symbol manipulation algorithms in such a way that the intent of the process is clear. I t will be the purpose of this paper to present a more suitable notation for description of compilers and other complicated symbol manipulation algorithms. The algorithms used in formula translation consist principally of the following elements: (1) A set of linguistic transformations upon the input string, together with conditions determining the applicability of each transformation. (2) A set of actions, such as the generation of machine language coding, associated with each transformation. (3) A rule for transfering the attention of the translator from one portion of the input string to another. The notation presented here greatly simplifies the representation of the first and third elements. For illustrative purposes, a compilation process for a small subset of ALGOL is described below. The subset consists of assignment statements constructed from identifiers, the five binary arithmetic operators ( T, × , / , 4 , ), the two unary arithmetic operators (-{-, --), the replacement operator ( : = ) , parentheses, and the library functions of one variable (sin, exp, sqrt, etc.). The assignment statement Z to be translated is initially taken in the augmented form ~ A2~ ~ , where the characters ~and ~ serve as termination symbols and a is a pointer which indicates the portion of the statement where the translator's attention is currently focused. The following productions and the associated generation rules respectively decompose the original statement in accordance with its structure, and simultaneously create coding to implement the statement. Coding will be represented by ALGOL statements with at most one operator, to avoid reference to particular computers.