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:

    Hast ever ben in Omaha
    Where rolls the dark Missouri down,
    Where four strong horses scarce can draw
    An empty wagon through the town?
    Where sand is blown from every mound
    To fill your eyes and ears and throat;
    Where all the steamboats are aground,
    And all the houses are afloat?...
    If not, take heed to what I say,
    You’ll find it just as I have found it;
    And if it lies upon your way
    For God’s sake, reader, go around it!
    —For the State of Nebraska, U.S. public relief program (1935-1943)