A digraph is a two-character code composed of a dollar character $ followed by any other character. The purpose of the digraph is two-fold.
Some characters are used to perform special functions in the ratmac language and RFPP preprocessor. These characters will perform these functions unless enclosed in an apostrophe string or preceded by a $. They are:
The following characters are used as relational operators in the ratmac language, except if contained in an apostrophe string or a the section called “chardata:, realdata: etc.”, or preceded by the digraph character $. The Fortran 'dot' relational operators (i.e. .NOT., etc.) may also be used but will be converted to the symbolic form by RFT unless contained within an apostrophe string or square brackets.
The minimum character set required for the preprocessing of ratmac is
The printed form of some of the special characters will vary from machine to machine. However the internal representations of these characters will remain consistent. Note that RFPP accepts any character, but requires the above set for correct execution of its instruction set. Lower-case characters (a to z) are automatically converted to upper-case unless inside an apostrophe string. Note also that the sharp (#) character may only be used actively inside an apostrophe string because it is used internally by RFPP as the end-of-line marker. A statement block is one or more lines of ratmac code executed by a single command. If the statement block is more than one line, it must be surrounded by open and close braces $( and $). For example:
command $( statement-block $)
If there is only one line of code, the open and close braces may be omitted. For example:
command single-line-statement or command single-line-statement# except for the DO command!
Ratmac lines may be ended in several ways. An expression may be delimited with a carriage return or # or ; or $( or $). For example, the following expressions are equivalent:
expression1 expression2 expression3
or expression1# a comment can go here! expression2; expression3# or here! or expression1; expression2; expression3#
Multi-line expressions may be concatenated in ratmac using the digraph $# or a comma ,#. Lines ending in these symbols are 'extended' into the next line. For example:
line1$# this is a continuation digraph line2
is treated as line1line2
line1,# note the comma on this line line2$# line3
becomes
line1,line2line3
Character strings are delimited by an apostrophe ' or a quote ". Character strings are output by RFPP enclosed by apostrophes ' (i.e. " is converted to ' for output). For example, 'This is a string 123*!' and "This is also a string"
Note that in both string types the 'case' of the characters is not changed and the blanks in the string are preserved by RFPP and RFT. Apostrophe strings are processed by RFPP differently to quote strings. An apostrophe string is treated as a single entity and the string contents are not evaluated. In contrast a quote string is treated similarly to a non-string expression. An apostrophe string may not exceed one line, while a quote string continues until the balancing quote is found. For example, this quote string is the same as the last example.
"This is $# the '$#' is the line extension indicator also a string"
The definition and application of character strings is considered futher under the the section called “chardata:, realdata: etc.”. |
|