Browse Prior Art Database

Table-Driven Function Sequence Selection

IP.com Disclosure Number: IPCOM000048447D
Original Publication Date: 1982-Feb-01
Included in the Prior Art Database: 2005-Feb-08
Document File: 3 page(s) / 98K

Publishing Venue

IBM

Related People

Adolphson, JM: AUTHOR [+4]

Abstract

Table-Driven Function Sequence Selection is the process of putting most or all of the logic of a program into a compact and exhaustive table. This process was very useful in developing the code generation phases of two compilers.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 54% of the total text.

Page 1 of 3

Table-Driven Function Sequence Selection

Table-Driven Function Sequence Selection is the process of putting most or all of the logic of a program into a compact and exhaustive table. This process was very useful in developing the code generation phases of two compilers.

OPERATION CODE TRANSLATION TABLE - INDEXES THE OPERATIONS TABLE: TOPCODE (256) FIXED (8) INIT( (see article Figure 3).

The process consists of three basic elements: (1) The Function Sequence Selection Table, hereafter called the Operations Table, (2) The set of Functions required to carry out all operations in the program, and (3) The Main Processing Loop.

The Operations Table (Fig. 1) is a two-dimension array containing the addresses of the functions. The rows are indexed by a predefined operation code (e.g., the "multiply" expression operator).

Once the row is selected, all of the functions (Fig. 2) whose addresses are in that row are executed in sequence from left to right. Then the next operator (see article Figure 4) is used to select another row and so on until all the operators are processed.

It is the responsibility of the programmer to put the appropriate Function addresses into the table rows in the correct order to perform the desired operation.

The Functions are mutually independent process blocks that are invoked by and return control to the Main Processing Loop.

In the actual implementations, a variation of this process is used. A one- dimension translation table (called the Operation Code Translation Table (Fig. 3) is used to reduce and combine the number of operation codes needed to index the operations table. A one-dimension Function Pointer Table (Fig. 4) is used to contain the addresses of all the functions. The Operations Table (Fig. 5) then contains not the addresses of the functions, but indexes into the Function Pointer Table.

The Main Processing Loop (Fig. 6) uses a Translated operation code to select a row in the Operations Table and then invokes each Function one by one and left to right by using the Function addresses indexed by (see article Figure 6) the values in that row. This looping continues until all functions for the selected op...