Clauses and Instructions - IBM-REXX

Clauses can be subdivided into the following types:

Null Clauses

A clause consisting only of blanks or comments or both is a null clause.It is completely ignored (except that if it includes a comment it is traced, if appropriate).

Tip:A null clause is not an instruction; for example, putting an extra semicolon after the THEN or ELSE in an IF instruction is not equivalent to using a dummy instruction (as it would be in PL/I).The NOP instruction is provided for this purpose.

Labels

A clause that consists of a single symbol followed by a colon is a label. The colon in this context implies a semicolon (clause separator),so no semicolon is required. Labels identify the targets of CALL instructions, SIGNAL instructions,and internal function calls. More than one label may precede any instruction. Labels are treated as null clauses and can be traced selectively to aid debugging.

Any number of successive clauses may be labels. This permits multiple labels before other clauses. Duplicate labels are permitted, but control passes only to the first of any duplicates in a program. The duplicate labels occurring later can be traced but cannot be used as a target of a CALL SIGNAL,or function invocation.

Instructions

An instructionconsists of one or more clauses describing some course of action for the language processor to take. Instructions can be: assignments, keyword instructions,or commands.

Assignments

A single clause of the form symbol=expression is an instruction known as an assignment.An assignment gives a variable a (new) value.

Keyword Instructions

A keyword instruction is one or more clauses, the first of which starts with a keyword that identifies the instruction. Keyword instructions control the external interfaces, the flow of control,and so forth. Some keyword instructions can include nested instructions. In the following example, the DO construct (DO, the group of instructions that follow it and its associated END keyword) is considered a single keyword instruction.

DO
instruction
instruction
instruction
END

A subkeywordis a keyword that is reserved within the context of some particular
instruction, for example, the symbols TO and WHILE in the DO instruction.

Commands

A commandis a clause consisting of only an expression.The expression is evaluated and the result is passed as a command string to some external environment.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM-REXX Topics