beautypg.com

Compaq DEC Text Processing Utility AA-PWCBD-TE User Manual

Page 80

background image

Lexical Elements of the DEC Text Processing Utility Language
4.9 Reserved Words

ENDCASE

Error statement

ON_ERROR

ENDON_ERROR

RETURN statement

ABORT statement

Miscellaneous declarations

EQUIVALENCE

LOCAL

CONSTANT

VARIABLE

GLOBAL, UNIVERSAL, BEGIN, and END are words reserved for future
expansion of the DECTPU language.

The DECTPU declarations and statements are reserved words that you cannot
define. Any attempt to redefine these words results in a compilation error.

4.9.4.1 Module Declaration

With the MODULE/ENDMODULE declaration, you can group a series of global
CONSTANT declarations, VARIABLE declarations, PROCEDURE declarations,
and executable statements as one entity. After you compile a module, the
compiler will generate two procedures for you. One procedure returns the
identification for the module and the other contains all the executable statements
for the module. The procedure names generated by the compiler are module-
name_MODULE_IDENT
and module-name_MODULE_INIT, respectively.

Syntax

MODULE module-name IDENT string-literal [[declarations]] [[ON_ERROR ...
ENDON_ERROR]] statement_1; . . . statement_n; ENDMODULE

The declarations part of a module can include any number of global VARIABLE,
CONSTANT, and PROCEDURE declarations.

The ON_ERROR/ENDON_ERROR block, if used, must appear after the
declarations and before the DECTPU statements that make up the body of
the module. Statements that make up the body of a module must be separated
with semicolons. For more information on error handlers, see Section 4.9.4.14.

In the following example, the compiler creates two procedures: user_mod_
module_ident
and user_mod_module_init. User_mod_module_ident returns the
string

"

v1.0

"

. User_mod_module_init calls the routine user_hello.

MODULE user_mod IDENT "v1.0"

PROCEDURE user_hello

MESSAGE ("Hello");

ENDPROCEDURE;

ON_ERROR

MESSAGE ("Good-bye");

END_ON_ERROR;

user_hello;
ENDMODULE

4–14 Lexical Elements of the DEC Text Processing Utility Language