ALGOL 68 - Program Representation

Program Representation

A feature of ALGOL 68, inherited from ALGOL tradition, is its different representations. There is a representation language used to describe algorithms in printed work, a strict language (rigorously defined in the Report) and an official reference language intended to be used in actual compiler input. In the examples above you will observe underlined words. This is the formal representation of the language. ALGOL 68's reserved words are effectively in a different namespace from identifiers, and spaces are allowed in identifiers, so the fragment:

int a real int = 3 ;

is legal. The programmer who actually writes the code does not have the option of underlining the code. Depending on hardware and cultural issues, different methods to denote these identifiers, have been devised, called stropping regimes. So all or some of the following may be possible programming representations:

'INT' A REAL INT = 3; .INT A REAL INT = 3; # the POINT stropping style # INT a real int = 3;# the UPPER stropping style # int a_real_int = 3;# the RES stropping style, there are 61 accepted reserved words #

All implementations must recognise at least POINT, UPPER and RES inside PRAGMAT sections.

The following characters were recommended for portability, and termed "worthy characters" in the Report on the Standard Hardware Representation of Algol 68:

  • ^ Worthy Characters: ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "#$%'*+,-./:;<=>@_|

This reflected a problem in the 1960s where some hardware didn't support lower-case, nor some other non ASCII characters, indeed in the 1973 report it was written: "Four worthy characters -- "|", "_", ""—are often coded differently, even at installations which nominally use the same character set."

  • Base characters: "Worthy characters" are a subset of "base characters".

Read more about this topic:  ALGOL 68

Famous quotes containing the word program:

    “Hear me,” he said to the white commander. “I am tired. My heart is sick and sad. Our chiefs are dead; the little children are freezing. My people have no blankets, no food. From where the sun stands, I will fight no more forever.”
    —For the State of Montana, U.S. public relief program (1935-1943)