Purpose
This is the assembler parser translator,
written in REXX, that parses the source identified by the SOURCE DDNAME.
Functions
One of the functions of an SCLM
parser is to determine all of a module's dependencies. FLMLRASM determines
all of the names that are to be copied into the Assembler source.
The
parser uses the following syntax rules to locate dependency names:
FLMLRASM will generate a dependency
for the MEMBER# token under the following conditions:
- MEMBER# is the first token of a statement and is not one of the
opcodes for the z/Series processors (including assembler extended
mnemonics, Vector facility and some obsolete 360/370 instructions).
- MEMBER# is the first token after a COPY or EXEC SQL INCLUDE instruction.
It can be on a continued line.
The following example illustrates
conditions under which dependencies will and will not be formed. Each
MEMBER# token appears in an example of syntax that the parser recognizes
as creating a dependency. A MEMBER# token can be from 1 to 8 characters.
The BADCPY# statements in the example will not create dependencies
for the following reasons:
- BADCPY1 follows an EXEC CICS® instruction;
dependencies are only generated for precompiler instructions (EXEC
SQL INCLUDE).
- BADCPY2 first appears in a macro definition, so no dependency
is created on subsequent appearances.
- BADCPY3 begins with an ampersand.
- BADCPY4 is not the first token of the statement in which it appears.
*<-Column 1 Column 72->
MEMBER1 rest of line
LABEL MEMBER2 rest of line
COPY MEMBER3 rest of line
COPY X
MEMBER4
* A COMMENT LINE ******************************************************
* DB2 PREPROCESSOR STATEMENTS - each is 1 statement, 1 dependency
EXEC SQL INCLUDE MEMBER5
EXEC SQL INCLUDE X
MEMBER6
* CICS PREPROCESSOR STATEMENT - 1 statement, no dependency
EXEC CICS BADCPY1
* Statements for which no dependency is generated
MACRO X
BADCPY2
&BADCPY3 rest of line
* previously defined macros ignored
BADCPY2 X
BADCPY4
* continued lines ignored, except after COPY & EXEC SQL INCLUDE
Another
function of the parser is to gather statistics or metrics for each
module to be parsed. There are ten such statistics saved by SCLM,
but only 8 are generated by this parser. For assembler, this parser
defines the ten statistics as follows:
- Total lines
- The total number of records in the file.
- Comment lines
- The number of lines with an asterisk in the first column.
- Noncomment lines
- The number of total lines minus the number of comment lines.
- Blank lines
- The number of lines that contain only blanks.
- Prolog lines
- The number of comment lines and blank lines that are found before
the first noncomment line.
- Total statements
- The number of comment statements plus the number of noncomment
statements.
- Comment statements
- This value is equal to the number of comment lines.
- Control statements
- This value is always 0.
- Assignment statements
- This value is always 0.
- Noncomment statements
- The number of statements whose first token is a reserved word,
plus the number of EXEC SQL and EXEC CICS instructions.
Parameters
The following guidelines apply
when specifying parameters:
- The order of the parameters is not important.
- See the language definitions provided by SCLM for the actual usage
of the parameters for FLMLRASM.
The following keyword parameters,
separated by commas, are required as input to FLMLRASM:
- LISTINFO
- Pointer to the SCLM list information record. This parameter is
required and must be set to @@FLMLIS.
- LISTSIZE
- The size of the LISTINFO buffer. This parameter is required and
must be set to @@FLMSIZ. The parser checks to make sure that the LISTSIZE
parameter is large enough to hold at least one entry of 228 bytes.
- STATINFO
- Pointer to the SCLM statistics information record. This parameter
is required and must be set to @@FLMSTP.
Return codes