Browse Prior Art Database

Single Phase, Context Driven Code Generation in a Program Compiler

IP.com Disclosure Number: IPCOM000077051D
Original Publication Date: 1972-Jun-01
Included in the Prior Art Database: 2005-Feb-24
Document File: 2 page(s) / 57K

Publishing Venue

IBM

Related People

Elson, M: AUTHOR [+2]

Abstract

Source code is compiled into machine code by a technique which requires only a single pass through each tree structure, instead of the usual multi-pass routines.

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 59% of the total text.

Page 1 of 2

Single Phase, Context Driven Code Generation in a Program Compiler

Source code is compiled into machine code by a technique which requires only a single pass through each tree structure, instead of the usual multi-pass routines.

Nondeclaratory statements in the source code are converted into tree text by any well known technique, for example that described in "A Syntax Oriented Translator" by P. Z. Ingerman, Academic Press, New York and London 1966. By using three push--down stacks the routine shown in the flow chart is performed.

The three push-down stacks are a CGR (Code Generation Routine) Stack which maintains the sequence of CGR's called in processing a text tree; a CURSOR Stack which maintains the sequence of cursor positions at nodes of a tree during processing of the text tree; and a COMMAND LOCATION Stack which maintains the location of the last command processed in each CGR during the processing of a text tree.

Essentially, the technique is a nesting process in which upon completion of which, each level of nest is successively called for until the lowest level is reached and processed. The next higher level is processed and so on back to the highest. The three stacks keep a track of the calling statements for each lower level, and a tree structure is processed from the general outer statement to the specific assignment or evaluation requests and then back out again towards the general.

The flow chart shows one form of implementation of the technique. Bo...