Line Formats

Ratmac source code may be subdivided into three general categories: preprocessor controls, ratmac commands and macro instructions. They may be summarised as follows:

Preprocessor controls

These controls enable the user to switch on and off certain RFPP functions. The flagon:, flagoff:, include:, extrude:, systemheader:, select:, ifsel: and endsel: macros control the listing, code inclusion and code conversion operations. Some of the special characters such as #, $#, $), etc. also fall into this category. the section called “Preprocessor Controls” are not output in the Fortran code.

Ratmac commands

These commands represent the bulk of the executable or 'active' code and are often output unaltered to the Fortran file. They include the specific ratmac control instructions FOR, DO, WHILE, REPEAT, IF, ELSE, ELSEIF, NEXT and BREAK. These instructions are translated into Fortran77 by the preprocessor. Ratmac commands are detailed the section called “Ratmac Commands ”.

Macro instructions

Macros may also be used to generate active Fortran code. The macro 'names' are not output, but their definitions usually are. Macro definition and invocation are detailed in the section called “Macro Instructions”.

General syntactical rules

These general rules apply to all of the above instruction categories.

  • ratmac source code may start in any column of a line

  • active code is terminated with a carriage return or a # (comments may follow a # on the same line)

  • multiple ratfor or macro statements may appear on a single line separated by a semicolon (;)

  • each line of ratmac code is considered as a separate line of Fortran code, unless the preceding active code ends with the continuation signals '$#' or ',#'

  • if the first character of an active line is a non-digit it is output in column 7 of the Fortran code

  • if digits start a line they are assumed to be a Fortran statement label

  • blank characters are not output in a Fortran line unless within quote or apostrophe strings, or in a macro defined string.