Go to the first, previous, next, last section, table of contents.


Structure

A GRG file is processed in three modes. The default is STANDARD mode where only predefined macro lines, comment lines or blank lines may be seen. Anything else will be treated as an error. The ARGS mode is used to process each of the arguments following a predefined macro name, until a newline where the mode reverts to STANDARD mode again. Some predefined macros may switch processing to the TEXT BODY mode. Within this mode user defined macros are expanded and equates are called. User defined macros are not expanded anywhere else. From TEXT BODY mode STANDARD mode is returned to when a predefined macro is encountered. The EQUATE mode is a special variant of TEXT BODY mode used only for processing equate definitions (user defined macros are also expanded in this mode).

Comments can be included in a GRG file in the STANDARD mode and the TEXT BODY mode. They are flagged by a %% sequence, followed by at least one whitespace character (space, tab or newline). This sequence and anything else up to and including a newline will be discarded. In TEXT BODY mode comments can only occur at the very start of a line (no preceeding whitespace) whereas in STANDARD mode there can be any amount of preceeding whitespace on the line. In the EQUATE mode C style comments are also supported and can occur anywhere. They are started with a /* sequence and ended with a */ sequence. Unlike C, nested comments are allowed.


Go to the first, previous, next, last section, table of contents.