VDE
VDE
Reference Manual


Previous Contents Index


Review Replacement Commands

The Review Replacement Commands are used to review replacements queued to the current library. The commands are valid at the VDEREVREP> prompt during the REVIEW REPLACEMENT command.

Format

DIRECTORY [mod-name [, mod-name...]]

SELECT [mod-name]

SHOW [keyword]

EDIT [keyword]

NEXT

BACK

CURRENT

FIRST

LAST

ACCEPT ["remark-string"]

REJECT "remark-string"

SPAWN

ATTACH

EXIT


Description

The REVIEW REPLACEMENT subsystem accepts the following commands at the VDEREVREP> prompt:


Script Keywords

The following keywords are used in VDE build scripts stored in the VDE database.

Requires CRESCRP privilege.


Format

EMIT

EXIT

FETCH


Description

Scripts are used to add various user-defined extensions to various VDE functions and commands. VDE invokes various scripts at various times during VDE processing---see Script Types for further information on this.

Scripts of various types are recorded in the VDE database. A script is a sequence of keywords in the VDE script language that VDE can execute to create a DCL command file. VDE can then invoke that DCL command file in a subprocess to perform the action of the script. VDE uses scripts to perform many different kinds of actions. For example, VDE uses "compile scripts" to compile modules in a build job. Similarly, it uses "new-stream scripts" to populate the directories of a new stream with files when it performs the CREATE STREAM command. There are many other kinds of scripts, all distinguished by the keywords or circumstances that cause them to be invoked.

The primary purpose of VDE scripts is to insert names and directory specifications from the VDE database into text you specify to generate DCL command files that perform various actions. A VDE script is thus a mixture of plain text and invocations of functions that retrieve names (such as module names, type names, and facility names) and directory strings (such as the names of facility subdirectories) from the VDE database.

Since you define scripts, you define how VDE should perform the corresponding actions. For example, you decide how a Pascal module is compiled because you define the Pascal compilation script. Similarly, you can define a script that defines auxiliary actions of the REPLACE command. Scripts thus let you make policy decisions for your own project, while VDE provides the mechanisms that implement your policies.

When a new development stream is created, all script definitions from the parent stream are copied to the child stream. If modified, the script definitions then evolve independently in the two development streams.

A VDE script is a sequence of text lines that contain VDE script keywords. There are only three VDE script commands: EMIT, FETCH, and EXIT.

In addition, a script may contain blank lines and comment lines. The exclamation point (!) is the comment character. VDE ignores any text on a script line after an exclamation point, provided the exclamation point is not within quotes. A script keyword command may be continued from one line to the next by ending the first line with the sequence space-minus ( --).

VDE accepts the following keyword commands in a script:

When executing a script, VDE executes successive script keywords from the script until it encounters an EXIT keyword or the end of the script. VDE executes FETCH keywords immediately as they are encountered. VDE writes all lines generated by EMIT keywords to the output DCL command file. At the end of the script, VDE executes that command file in a subprocess to perform the action of the script.

Selection of Scripts

Many types of scripts are invoked when a certain operation must be applied to a specific module, such as compiling or reserving the module. For such operations, VDE must select the script that is appropriate to the module. The type of the script is of course the primary selection criterion, but even for a given type, different scripts are needed for different modules. The script that compiles a Fortran module is not appropriate for a C module, for example, and the script that links one image cannot link another. (Script Functions contains the types of scripts supported by VDE.)

To accommodate such situations, VDE lets you specify how scripts are selected based on the module name. You can specify that a script should be used only for a specific module, for all modules of a certain type in a given facility, for all modules of a given type regardless of facility, or for all modules regardless of type or facility. When you create such a script, you specify the script type with a qualifier, such as /COMPILE or /RESERVE. You also specify the modules to which the script applies through a module-name parameter to the qualifier. A restricted form of wildcarding determines what modules the script can be used for. The following module-name specifications are allowed:

No other forms of wildcarding are allowed in the module-name parameters to script-type qualifiers.

When VDE looks for a script to perform some action for a module, it always selects the script that is most specific to that module. If it can find a script with a fully specified module name ([FACIL]MOD.TYP) for the module in question, it uses that script. Otherwise, it looks for a script with a matching module-name specification of the form [FACIL]*.TYP or [*]*.TYP or [*]*.*, in that order. This rule allows you to specify generic scripts that apply to all modules or to all modules of a certain type, but to override those scripts for specific modules or for modules in specific facilities when appropriate.

Similar rules apply to scripts that are selected by facility. A NEW_STREAM script, for example, is invoked for each facility in your system when you create a new stream. In this case, VDE accepts two forms of facility-name specification on the script-type qualifiers:

No other forms of wildcarding are allowed in the facility-name parameters to script-type qualifiers.

When VDE looks for a script to perform an action for a facility, it first looks for a script with a fully specified facility name. If no such script exists in the database, VDE selects the script with the wildcard in the facility name, provided it exists. You can thus specify a generic script that applies to all facilities, and then override that script for specific facilities when appropriate.

Generating Command Files in Segments

Normally, VDE generates the DCL command file to perform some action from a single VDE script. In some situations, however, it is necessary to generate different "segments" of the DCL command file from different scripts. The DCL command file that compiles a MACRO module, for example, may need to consist of three segments:

One VDE script could generate all three segments of the DCL command file, but then a separate script is needed for each MACRO module in the library. This solution is undesirable because the script keywords that generate the first and third segments of the DCL command file are the same for all MACRO modules, thus wasting space in the VDE database and making it difficult to modify the common parts of the scripts. A better solution is to have two generic scripts with selection templates [*]*.MAR that generate the first and third segments of each MACRO module's DCL command file, and to have a small script specific to each module to generate the second segment. This solution makes it easy to modify the module-independent segments of the keyword files because they are derived from just two VDE scripts.

To allow you to generate different segments of a DCL command file from separate scripts, VDE allows you to assign a segment number to each script. A segment number is an integer value in the range from 1 to 20 that is specified with the /SEGMENT qualifier to the CREATE SCRIPT command. When VDE generates a DCL command file from scripts, it looks for an appropriate script for each possible segment number. VDE selects the script for each segment number using the normal script selection rules so that more module-specific or facility-specific scripts are favored over more generic scripts. After selecting the scripts, VDE interprets them in order by segment number to generate the DCL command file. If there are no scripts for a given segment, that segment is simply omitted from the command file. As a result, you can have up to twenty segments in a DCL command file, each generated by a separately selected script.

If you do not specify a segment number for a script, VDE assigns segment number 10 to the script. If your DCL command files do not need multiple segments, you can thus ignore segment numbers and let VDE generate segment 10 (and only that segment) for each command file. If you later decide that you need additional segments before or after the original segment, you have ample segment numbers to choose from in both directions.

Debugging Scripts

The INVOKE SCRIPT command is a useful tool for debugging scripts. INVOKE SCRIPT allows you to fetch and invoke a specified script, and then to examine the DCL command(s) generated by the script.

For further information on this command, see INVOKE SCRIPT.


Examples

#1

$ TYPE [MYDIR]SCRIPT_C.VDESCRIPT
! Script to compile a C module.
!
EMIT "$ SET VERIFY"
EMIT "$ DEFINE/NOLOG SRC$ ", $DIR(SRC)
EMIT "$ DEFINE/NOLOG OBJ$ ", $DIR(OBJ)
EMIT "$ CC/DEBUG/OBJ=OBJ$:/ANA=OBJ$: SRC$:",$MODTYP
EMIT "$ VDE/DEPEND C OBJ$:",$MOD,".ANA"
EXIT
$ VDE
VDE„ CREATE SCRIPT/COMPILE=[RMS]*.C [MYDIR]SCRIPT_C.VDESCRIPT
%VDE-I-SCRPADDED, script from file DEV$:[MYDIR]SCRIPT_C.VDESCRIPT;9 added to
 the database
 script to compile module [RMS]*.C (segment 10)
%VDE-I-COMMIT, database transaction has successfully committed
VDE„
      

In this example, the user first types the script file [MYDIR]SCRIPT_C.VDESCRIPT on the terminal. The script contains five EMIT keywords followed by an EXIT keyword. The user then enters VDE and uses the CREATE SCRIPT keyword to enter that script file into the VDE database as the compile script for all C modules in facility RMS. The log messages confirm that the script was successfully entered into the database.

#2

$ TYPE [MYDIR]SCRIPT_LINK_X.VDESCRIPT
! VDE script to generate the DCL commands needed to link module X.EXE.
!
EMIT "$ SET VERIFY"
EMIT "$ DEFINE OBJLIB ", $DIR(OBJ,CODE)
EMIT "$ LINK/EXE=OBJLIB:X.EXE/MAP=OBJLIB:X.MAP  -"
EMIT "        OBJLIB:OBJLIB.OLB/INCLUDE=C,OBJLIB:OBJLIB.OLB/LIBRARY"
EMIT "$ DEASSIGN OBJLIB"
$ VDE
VDE„ CREATE SCRIPT/LINK=X.EXE [MYDIR]SCRIPT_C
%VDE-I-SCRPADDED, script from file DEV$:[MYDIR]SCRIPT_LINK_X.VDESCRIPT;2
 added to the database
 script to link module [CODE]X.EXE (segment 10)
%VDE-I-COMMIT, database transaction has successfully committed
VDE„ SHOW SCRIPT/TEXT/LINK=X.EXE
Script to link module [CODE]X.EXE (segment 10)
   Text of script:
     1: ! VDE script to generate the DCL commands needed to link module X.EXE.
     2: !
     3: EMIT "$ SET VERIFY"
     4: EMIT "$ DEFINE OBJLIB ", $DIR(OBJ,CODE)
     5: EMIT "$ LINK/EXE=OBJLIB:X.EXE/MAP=OBJLIB:X.MAP  -"
     6: EMIT "        OBJLIB:OBJLIB.OLB/INCLUDE=C,OBJLIB:OBJLIB.OLB/LIBRARY"
     7: EMIT "$ DEASSIGN OBJLIB"
 
VDE„
      


Previous Next Contents Index