Previous | Contents | Index |
Begin at the following expansion developed in Section C.1.3.
test: procedure options(main); [statement]... end test; [procedure]... |
Expand the list placeholder [statement] to display a menu and select the option ASSIGNMENT.
test: procedure options(main); -> {target_variable}...={expression}; [statement]... end test; [procedure]... |
Expand the placeholder {target_variable} to display a menu and select the option {SCALAR_VARIABLE}.
test: procedure options(main); -> {SCALAR_VARIABLE},[target_variable]...={expression}; [statement]... end test; [procedure]... |
Enter general over the placeholder {SCALAR_VARIABLE} and erase the placeholder [target_variable]. Enter 'Lee' over the placeholder {expression}.
test: procedure options(main); -> general='Lee'; [statement]... end test; [procedure]... |
Begin at the following expansion developed in Section C.1.3.
test: procedure options(main); [statement]... end test; [procedure]... |
Expand the placeholder [statement] to display a menu and select the option DECLARE.
test: procedure options(main); -> declare {declaration}...; [statement]... end test; [procedure]... |
Expand the list placeholder {declaration} to display a menu and select the option {NON_STRUCTURE_DECLARATION}.
test: procedure options(main); declare -> {NON_STRUCTURE_DECLARATION}..., [declaration]...; [statement]... end test; [procedure]... |
Expand the placeholder {NON_STRUCTURE_DECLARATION} to display a menu and select the option {SIMPLE_DECLARATION}.
test: procedure options(main); declare -> {identifier}[array_bounds] [datatype] [storage_class], [declaration]...; [statement]... end test; [procedure]... |
Enter what_if over the placeholder {identifier} and erase the placeholder [array_bounds].
test: procedure options(main); declare -> what_if [datatype] [storage_class], [declaration]...; [statement]... end test; [procedure]... |
Expand the placeholder [datatype] to display a menu and select the option [BIT_DATATYPE].
test: procedure options(main); declare -> what_if bit[string_length_opt] [aligned] [storage_class], [declaration]...; [statement]... end test; [procedure]... |
Erase the placeholder [string_length_opt] and expand the placeholder [aligned].
test: procedure options(main); declare -> what_if bit aligned [storage_class], [declaration]...; [statement]... end test; [procedure]... |
Expand the placeholder [storage_class] to display a menu and select the option [CONTROLLED].
test: procedure options(main); declare -> what_if bit aligned controlled [external], [declaration]...; [statement]... end test; [procedure]... |
Erase the placeholders [external] and [declaration].
test: procedure options(main); declare -> what_if bit aligned controlled; [statement]... end test; [procedure]... |
Begin at the following expansion developed in Section C.1.3.
test: procedure options(main); [statement]... end test; [procedure]... |
Expand the placeholder [statement] to produce a menu and select the option ASSIGNMENT.
test: procedure options(main); -> {target_variable}...={expression}; [statement]... end test; [procedure]... |
Expand the placeholder {target_variable} to display a menu and select the option {SCALAR_VARIABLE}.
test: procedure options(main); -> {SCALAR_VARIABLE},[target_variable]...={expression}; [statement]... end test; [procedure]... |
Enter vhf over the placeholder {SCALAR_VARIABLE}. Erase the placeholder [target_variable]. Enter substr over the placeholder {expression} and expand substr.
test: procedure options(main); -> vhf=substr({string_expression},{position}[length_option]); [statement]... end test; [procedure]... |
Enter 'where''s dixie' over the placeholder {string_expression}.
test: procedure options(main); -> vhf=substr('where''s dixie',{position}[length_option]); [statement]... end test; [procedure]... |
Enter the value 9 over the placeholder {position}. Expand the placeholder [length_option], and enter the value 5 over the placeholder {integer_expression}.
test: procedure options(main); -> vhf=substr('where''s dixie',9,5); [statement]... end test; [procedure]... |
Begin at the following expansion developed in Section C.1.3.
test: procedure options(main); [statement]... end test; [procedure]... |
Erase the list placeholder [statement]. Enter %proc and expand it.
test: procedure options(main); -> %{identifier}: procedure [parameters] [statement_option] returns({prep_attribute}); [prep_proc_statements]... return({prep_expression}); %end; end test; [procedure]... |
Enter f over the placeholder {identifier}.
test: procedure options(main); -> %f: procedure [parameters] [statement_option] returns({prep_attribute}); [prep_proc_statements]... return({prep_expression}); %end; end test; [procedure]... |
Erase the placeholders [parameters] and [statement_option].
test: procedure options(main); -> %f: procedure returns({prep_attribute}); [prep_proc_statements]... return({prep_expression}); %end; end test; [procedure]... |
Enter char over the placeholder {prep_attribute} and erase the placeholder [prep_proc_statements].
test: procedure options(main); -> %f: procedure returns(char); return({prep_expression}); %end; end test; [procedure]... |
Enter time() over the placeholder {prep_expression}.
test: procedure options(main); %f: procedure returns(char); -> return(time()); %end; end test; [procedure]... |
The DEC Source Code Analyzer (SCA) is an interactive source code cross-reference and static analysis tool that works with most OpenVMS programming languages. SCA helps developers keep track of the details of complex, large-scale software systems by displaying source information in response to user queries. SCA uses data generated by the PL/I compiler to supply the requested source information. That information is stored in a unique location, the SCA library. The data in an SCA library consists of the names of, and information about, all the symbols, modules, and files encountered during a specific compilation of the source.
SCA has both cross-reference and static analysis query features. Cross-referencing supplies information about program symbols and source files. Cross-referencing features include the following:
The static analysis query features of SCA provide structural information on the interrelation of routines, symbols and files. Static analysis features include the following:
SCA is fully integrated with LSE to provide extended features. By using
SCA with LSE, you can view any portion of an entire system and edit
related source files.
C.2.1 Multimodular Development
The cross-referencing and static analysis features of SCA can become useful during the implementation and maintenance phases of a project that involves many programming modules. For example, Figure C-1 shows a project team work area that contains a set of source modules. To keep track of these modules in their various development stages, the team can use a code management tool, such as Code Management System (CMS), which is represented in the figure by the CMS Library.
Figure C-1 Use of SCA for Multimodular Development
When the team compiles the source code, a /ANALYSIS_DATA qualifier to the COMPILE command instructs the PL/I compiler to generate SCA-required source information (.ANA data files) from the sources. The team then instructs SCA to load the .ANA files into a previously established SCA Library.
When a team member wants to do additional development work on specific modules, that member sets up an individual work area. Such individual work areas might consist of the following:
To make available the module-viewing capabilities of SCA/LSE integration, the project team member must inform LSE of the locations of latest sources, and the related source information. The team member provides pointers to these locations by supplying a search list for LSE. The search list first points to source modules in individual team members' default directories, and then points to the remaining modules in the project source directory. With such an arrangement, each member can effectively see through the local work area to the project-wide area. If an individual work area contains only new modules, and all of the work can be done with local resources, the team member need not specify the pointers to the project-wide area.
The following sections provide a general overview of SCA and discuss
some of the commands that are available to you while using SCA within
LSE. For detailed information on SCA and its use with various
programming languages, refer to the manual Using DECset for VMS Systems.
C.2.2 Setting Up an SCA Environment
To set up an SCA environment, you must take the following steps:
You are then ready to use SCA to conduct source information queries.
C.2.2.1 Creating an SCA Library
To use SCA, you must have an SCA library to store the detailed source analysis data that the PL/I compiler collects. Source analysis data is information about all of the symbols, files and modules contained in the source.
To create an SCA library you first create a subdirectory at the DCL level. For example:
$ CREATE/DIRECTORY PROJ:[USER.LIB1] |
This command creates a subdirectory LIB1 for a local SCA library.
To initialize a new SCA library you specify the CREATE LIBRARY command. This command has the following form:
CREATE LIBRARY [/qualifier...] directory-spec[,...] |
For example:
$ SCA CREATE LIBRARY [.LIB1] |
This command initializes and activates library LIB1.
C.2.2.2 Generating the Data Analysis Files
SCA uses detailed source data that is generated by the PL/I compiler. When you specify the /ANALYSIS_DATA qualifier on the PLI command, the generated data is output to a file with the default type .ANA. For example:
$ PLI/LIST/DIAGNOSTICS/ANALYSIS_DATA PG1,PG2,PG3 |
This command line compiles the input files PG1.PLI, PG2.PLI, and
PG3.PLI, and generates four corresponding output files for each input
file with the file types OBJ, LIS, DIA, and ANA. SCA puts these files
in your current default directory unless you specify otherwise.
C.2.2.3 Loading Data Analysis Files into a Local Library
Before you can examine the information in the compiler-generated source analysis (.ANA) files, you must load the files into an SCA library using the LOAD command. The LOAD command has the following form:
LOAD [/qualifier...] file-spec[,...] |
For example:
LSE> LOAD PG1,PG2,PG3 |
This command loads your library with the modules contained in the data
analysis files PG1, PG2, and PG3.
C.2.2.4 Selecting an SCA Library
To select an existing SCA library to use with your current SCA session, use the SET LIBRARY command. The command has the following form:
SET LIBRARY [/qualifier...] directory-spec[,...] |
A message appears in the message buffer at the bottom of your screen,
indicating whether your SCA library selection succeeded.
C.2.3 Using SCA for Cross-Referencing
Once you have set up your SCA environment, you can ask for symbol or file information by using the SCA command FIND. The FIND command has the following form:
FIND [/qualifier...] [name-expression[,...]] |
name-expression
The name-expression can be explicit (for example, ABC) or can contain wildcards (for example, ABC* or AB%).
For example:
LSE> FIND ABC,XY% |
You can query an SCA library for the following:
Name | A series of characters that uniquely identifies a symbol or a file. |
Item | An appearance of a symbol (such as a variable, constant, label, or procedure) or a file. |
Occurrence | The use of a symbol or a file. |
To limit the information resulting from a query, you can use qualifiers on the FIND command, such as the /DECLARATIONS and /REFERENCE qualifiers. For example:
LSE> FIND/REFERENCES=CALL BUILD_TABLE |
This command causes SCA to report only references in the source code where the routine BUILD_TABLE is called.
When you first issue a FIND command within LSE, you initiate a query session. Within this context, the integration of LSE and SCA provides the following commands that can be used only within LSE:
NEXT
PREVIOUS ----- NAME ITEM OCCURRENCE QUERY STEP |
Closely associated commands that let you step through one or more query buffer displays within LSE. |
GOTO SOURCE | Displays the source corresponding to the current query item. |
GOTO DECLARATION | Positions the cursor on a symbol declaration in one window, and displays the source code that contains the symbol declaration in another window. |
Previous | Next | Contents | Index |