Prior to this rewrite of the compile preprocessor, Y* directives specified in EXCUSRSRC were automatically inserted into the generated source of functions which call the EXCUSRSRC function prior to any Z* directives (i.e. as pre-compilation commands). In addition, the RPGIV generator allowed users to specify X* directives in EXCUSRSRC, which were automatically inserted into the generated source of functions which call the EXCUSRSRC function as Y* directives after any Z* directives (i.e. as post-compilation commands).
The following should be noted when including compile preprocessor directives in EXCUSRSRC within CA 2E
/*
compile preprocessor directives
/*
The /* directives can contain directives, e.g. '/* Start of preprocessor block' but will not be generated into the source. Only a single /* directive should start and end the preprocessor directive block.
Directives within a preprocessor directive block are copied into the final source member prior to any Z* directives, until a Z* directive is found in the preprocessor directive block. If a non-blank Z* directive is found, it is inserted into the source with the default Z* directives generated into all 2E functions. If a blank Z* directive is found, it will not be generated into the source, but it will be used to delimit pre- and post-compilation commands (see the section on "Separation of pre- and post-compilation commands" for more details). All subsequent preprocessor directives are inserted into the final source member after any Z* directives.
For instance, if an EXCUSRSRC function contains the following code:
/* Start of preprocessor directive block
Y* SNDMSG MSG('About to compile...') TOUSR(*REQUESTER)
X* QRPGSRC,DOCSRC1
P* QGPL/PREPROCRPG
Z* USRPRF(*OWNER)
P* QGPL/PSTPROCRPG
X* QRPGSRC,DOCSRC2
Y* SNDMSG MSG('Compilation completed!') TOUSR(*REQUESTER)
/* End of preprocessor directive block
Then the final code that would be seen in the source of a function that calls this EXCUSRSRC would be as follows:
...
Y* SNDMSG MSG('About to compile...') TOUSR(*REQUESTER)
X* QRPGLESRC,DOCSRC1
P* QGPL/PREPROCRPG
Z* <default-2E-compile-overrides>
Z* USRPRF(*OWNER)
P* QGPL/PSTPROCRPG
X* QRPGLESRC,DOCSRC2
Y* SNDMSG MSG('Compilation completed!') TOUSR(*REQUESTER)
...
The first three directives of the EXCUSRSRC (not including the starting '/*' directive) have been inserted into the source. Next come the default Z* directives that are generated for 2E functions, followed by the Z* directive from the preprocessor directive block. Finally, the last three directives in the preprocessor block (not including the ending '/*' directive) are inserted into the source.
|
Copyright © 2014 CA.
All rights reserved.
|
|