Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Syntax Directed Compiler

IP.com Disclosure Number: IPCOM000080189D
Original Publication Date: 1973-Nov-01
Included in the Prior Art Database: 2005-Feb-27
Document File: 3 page(s) / 16K

Publishing Venue

IBM

Related People

McNabb, DL: AUTHOR [+2]

Abstract

A compiler may be arranged to compile sequences of statements of a high-level machine-dependent language, for generating sequences of object code for the operation of a specific machine. An example of the general design of such a compiler is described, but no specific compiler is now, or contemplated to become, available. Generally speaking, the statements may have a one-to-one relation with object instructions, such that the programmer retains complete control over the hardware. The implementation employs a syntax-directed scanning technique, and the design is highly parameterized for ease of maintenance and modification. The basic form is that a program is a procedure, which may contain wholly nested procedures. This permits block structure and the name scoping capabilities.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 51% of the total text.

Page 1 of 3

Syntax Directed Compiler

A compiler may be arranged to compile sequences of statements of a high- level machine-dependent language, for generating sequences of object code for the operation of a specific machine. An example of the general design of such a compiler is described, but no specific compiler is now, or contemplated to become, available. Generally speaking, the statements may have a one-to-one relation with object instructions, such that the programmer retains complete control over the hardware. The implementation employs a syntax-directed scanning technique, and the design is highly parameterized for ease of maintenance and modification. The basic form is that a program is a procedure, which may contain wholly nested procedures. This permits block structure and the name scoping capabilities. A DECLARE statement is used as the principal way to name storage and constants. However, there are no implicit naming rules, so that all names must be declared explicitly. Finally, the computational statements are essentially limited to the assignment statement, the GO TO statement, the CALL statement, and the RETURN statement.

Syntactically, a free form is used, so that one or more statements may occupy a line, and comments, enclosed by `/*' and `*/', may appear within or between statements. Blanks are significant, only in that they may be used as well as other punctuation to terminate identifiers, constants, etc.

A `<-' is used to denote assignment. 0perations are enclosed in `|', such as in the operations |+| and |-|. Hexadecimal constants are enclosed in quotes, followed immediately by the letter X.

It is possible to specify numerous latches, bits, switches, etc., ancillary to the main instruction, thereby providing many variants to a single instruction. This is achieved by using an optional WTTH field. A branching capability is also available in the GO TO field.

Finally, indexed branches are permitted by the specification of indexed labels and their use in the GO TO statements.

A program must itself be a block which may maintain other blocks nested to any arbitrary depth. All the declarative statements in a given block must appear before the procedural statements in that block, and all the procedural statements must appear before the beginning of an inner block, i.e., contained blocks must appear at the end of containing blocks.

A block is headed by a PROCEDURE statement in the form: <label> : PROCEDURE;

The <label> names the procedure and becomes the name of the code module; it should consist of a letter followed by 3 alphanumeric characters. The PROCEDURE statement is used to establish the scope of variable names used in the program. By this means, a variable name may be defined in an inner block, to have entirely different attributes from those associated with the same name in an outer or disjoint block. Thus the block structure may be used to build

1

Page 2 of 3

programs from independently produced pieces. The END statement...