10.2. Numbers

Numerical constants appearing in other sections of this definition are of the following types:

  1. Constants for presetting, optionally signed.

  2. Integers and reals as primaries in expressions. A sign attached to a primary belongs syntactically to the expression and not to the number.

  3. Integers and signed integers used in declarations or specifications, typically for defining fixed scales, bit-fields and array bounds.

The syntactic classification is as follows:

Constant ::= 
     Number
     Addoperator  Number 

Number ::= 
     Real
     Integer 

Signedinteger ::= 
     Integer
     Addoperator  Integer 

Real ::= 
     Digitlist .  Digitlist
     Digitlist 10 Signedinteger
         10 Signedinteger
     Digitlist .  Digitlist 10 Signedinteger
        OCTAL ( Octallist .  Octallist ) 

Integer ::= 
     Digitlist
        OCTAL ( Octallist )
        LITERAL ( printing character )

The further expansions are

Digitlist ::= 
     Digit
     Digit Digitlist

Octallist ::= 
     Octaldigit
     Octaldigit Octalist

Octaldigit ::= 0 1 2 3 4 5 6 7

where 0 to 7 are alternatives.