Single-Scan Techniques for the Translation of Arithmetic Expressions in ALGOL 60

  • Authors:
  • B. Randell;L. J. Russell

  • Affiliations:
  • The English Electric Company Limited, Automatic Programming Section, Atomic Power Division, Whetstone, England;The English Electric Company Limited, Automatic Programming Section, Atomic Power Division, Whetstone, England

  • Venue:
  • Journal of the ACM (JACM)
  • Year:
  • 1964

Quantified Score

Hi-index 0.02

Visualization

Abstract

The first section of the paper contains a brief description of the well-known technique of using a stack, or pushdown store, to re-order the operators of an arithmetic expression, as defined in ALGOL 60, in order to transform the expression into Reverse Polish parenthesis-free form. It is shown that improvements to this Reverse Polish form can be made quite simply, by extending the use of the stack to include information about the operands of the expression. Firstly, information gained from the declarations of the operands can be used to control the generation of real-integer conversion instructions. Secondly, operators whose operands are numerical constants can be computed during translation, using the partially generated Reverse Polish object program as a second stack.