Syntax

The widespread use of syntax-driven methods of compilation lends increasing importance to the syntax methods of language description. The present definition takes the form of a commentary on the syntax of Coral 66, and therefore starts with broad structure, working downwards to finer detail. For reasons of legibility, the customary Backus notation has been dropped in favour of a system relying on typographical layout. Each syntax rule has on its left-hand side a class name, such as Statement. Such names appear in lower case without spaces, and with an initial capital letter. On the right-hand side of a rule are found the various alternative expansions for the class. The alternatives are printed each on a new line. Where a single alternative spreads over more than one line of print, the continuation lines are inset in relation to the starting position of the alternatives. Each alternative expansion consists of a sequence of items separated by spaces. The items themselves are either further class names or terminal symbols such as BEGIN. The class name Void is used for an empty class. For example, a typical pair of rules might be


        Specimen ::= 
    ALPHA
        Sign
        BETA
        Sign
      


        Sign ::= 
    +
        -
        Void
      

Examples of legal specimens are ALPHA+ and BETA. The equal sign is used to separate the left-hand side from the right, except after its first appearance in a rule.