18.10.2014 Views

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>SIMSCRIPT</strong> <strong>II.5</strong> <strong>Programming</strong> <strong>Language</strong><br />

6.9 Deletion of Set Routines<br />

Certain routines are automatically generated for each defined set during the processing of a program<br />

preamble. Sets declared as FIFO (explicitly or implicitly), LIFO, or ranked require different routines<br />

to perform their filing and removing operations. Each generated routine is tailored to individual<br />

program specifications reflecting such operations as set attribute deletions and cascaded set<br />

rankings.<br />

The most generally defined set, an unranked one declared as either FIFO or LIFO, has seven routines<br />

generated for it. Four are for filing and three for removing. The routines are named and their<br />

functions stated in table 6-4.<br />

Table 6-4. Set Manipulation Routines<br />

Routine<br />

Generated<br />

Name<br />

Function<br />

File first T.set Files an entity first or ranked<br />

File last U.set Files an entity last<br />

File before V.set Files an entity before a specified entity<br />

File after W.set Files an entity after a specified entity<br />

Remove first X.set Removes the first entity<br />

Remove last Y.set Removes the last entity<br />

Remove specific Z.set Removes a specified entity<br />

A set declared by the statement:<br />

define QUEUE as a FIFO set<br />

thus has seven routines, T.QUEUE, U.QUEUE, ..., Z.QUEUE generated for it.<br />

Ranked sets, by their definition, do not permit filing first, last, or before or after a specific entity<br />

without attention to the specified set ranking. Hence, ranked sets generate four routines, there being<br />

only one file routine.<br />

In addition, certain set operations are impossible if specific set attributes are not present. For instance,<br />

"filing before" is impossible in a LIFO set if the predecessor attribute has been deleted.<br />

Table 6-5 shows the set attributes that must be present for the indicated set operations to be performed.<br />

Because all set attributes are not required for all set operations, table 6-5 can be used to<br />

determine which attributes to delete in order to save memory space. For example, if a program only<br />

files and removes first, the set attributes L and P can be deleted without penalty. If they are not deleted,<br />

the generated programs keep track of and update them anyway.<br />

278

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!