MODULE SCA$REPORT_2167A_DESIGN IDENT "T4.0-3" !************************************************************************* ! * ! © 2000 BY * ! COMPAQ COMPUTER CORPORATION * ! © 2000 BY * ! ELECTRONIC DATA SYSTEMS LIMITED * ! * ! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED * ! ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE * ! INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER * ! COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY * ! OTHER PERSON. NO TITLE TO OR OWNERSHIP OF THE SOFTWARE IS HEREBY * ! TRANSFERRED. * ! * ! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE * ! AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY COMPAQ COMPUTER * ! CORPORATION OR EDS. * ! * ! NEITHER COMPAQ NOR EDS ASSUME ANY RESPONSIBILITY FOR THE USE OR * ! RELIABILITY OF THIS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY * ! COMPAQ. * ! * !************************************************************************* !++ ! Facility: ! SCA - Source Code Analyzer ! REPORT - Report Subfacility ! ! Abstract: ! This module implements the DOD-STD-2167A Software Design Document report. !-- ! Global variables used in this module: ! VARIABLE sca$report_CSC_file_name, sca$report_CSC_component_name, sca$report_sub_csc_file_name, sca$report_unit_file_name; PROCEDURE sca$report_2167a_design !++ ! FUNCTIONAL DESCRIPTION: ! ! This is the Digital-specific routine for the 2167A design report. ! Customers who wish to modify this routine should first rename it. ! Options for this report are described in SCA$REPORT_CUSTOMIZATIONS.TPU. ! ! FORMAL PARAMETERS: ! ! None !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_2167A_DESIGN'); ENDON_ERROR; ! Do report initialization (create buffers, open the output file, etc.). ! sca$report_portable_initialization; ! Build the report definition. ! sca$report_build_definition_2167a_design; ! Generate the report. ! sca$report_process_queries; ! Do common cleanup ! sca$report_post_process; sca$report_common_cleanup; RETURN; ENDPROCEDURE PROCEDURE sca_report_define_options_2167a_design !++ ! FUNCTIONAL DESCRIPTION: ! ! Define the valid options for the 2167A_DESIGN report. ! ! FORMAL PARAMETERS: ! ! None !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA_REPORT_DEFINE_OPTIONS_2167A_DESIGN'); ENDON_ERROR; ! Define valid options for the 2167A_DESIGN report. ! sca$report_add_valid_option ('domain_query', '', 'sca$report_process_option_domain_query'); sca$report_add_valid_option ('fill', True, 'sca$report_process_option_boolean'); sca$report_add_valid_option ('output', '', 'sca$report_process_option_output'); sca$report_add_valid_option ('target', 'SDML', 'sca$report_process_option_formatted_target'); sca$report_add_valid_option ('list_style', sca$report_k_list_numbered, ''); sca$report_add_valid_option ('literal_angle_brackets', True, 'sca$report_process_option_boolean'); sca$report_add_valid_option ('sca_debug_messages', False, 'sca$report_process_option_boolean'); sca$report_add_valid_option ('status_messages', True, 'sca$report_process_option_boolean'); sca$report_add_valid_option ('traceback_flag', True, 'sca$report_process_option_boolean'); sca$report_add_valid_option ('trace_messages', False, 'sca$report_process_option_boolean'); sca$report_add_valid_option ('use_source_spelling', True, 'sca$report_process_option_boolean'); ENDPROCEDURE PROCEDURE sca$report_build_definition_2167a_design !++ ! FUNCTIONAL DESCRIPTION: ! ! Build the report definition array for the 2167A_DESIGN report. ! ! FORMAL PARAMETERS: ! ! None !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_BUILD_DEFINITION_DESIGN'); ENDON_ERROR; ! Build the main definition for this report. It will have 26 entries. ! sca$report_create_definition (26); !------------------------------------------------------------------------- ! domain entry: ! level 1 ! domain_query ! attribute - type NAME, location file_name ! entity_query_name - SCA$REPORT_CURRENT_FILE ! sca$report_definition_add_entry (1, 1, 1, 2); sca$report_definition_add_label ('domain entry'); sca$report_definition_add_query (sca$report_k_query_domain); sca$report_definition_add_info (sca$report_k_info_type_name, sca$report_location_file_name); ! Action routine for after empty query - set up query for CSC tags. ! sca$report_definition_add_action_routine ( 'sca$report_setup_csc_nodomain_query', sca$report_k_invoke_after_empty_query); ! Action routine for after all entities (if query is non-empty) - set up ! query for CSC tags. ! sca$report_definition_add_action_routine ( 'sca$report_setup_csc_tag_query', sca$report_k_invoke_after_all_entities); !------------------------------------------------------------------------- ! CSC tags entry: ! level 1 ! CSC_tags_query (built at run-time) - find component names in all files ! of the domain by getting all keywords contained in COMPONENT tags. ! attribute - type TAG_NAME, location tag_name ! attribute - type SOURCE_LOCATION, location source_location ! sca$report_definition_add_entry (1, 1, 2, 3); sca$report_definition_add_label ('CSC tags entry'); ! The query to get all CSC tags for the report depends on the value of the ! /DOMAIN qualifier, and is set up by an action routine for the domain ! entry (above). ! sca$report_definition_add_query (0); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_source_file, sca$report_location_source_file); sca$report_definition_add_entity_name ('SCA$REPORT_CURRENT_CSC_TAG'); ! Action routine for after query - write report prefix. ! sca$report_definition_add_action_routine ( 'sca$report_start_2167A_design', sca$report_k_invoke_after_query); ! Action routine for before each entity - set sca$report_CSC_file_name for ! use in forming dynamic queries, and write header. ! sca$report_definition_add_action_routine ( 'sca$report_setup_csc', sca$report_k_invoke_before_each_entity); ! Action routine for after each entity - standard file cleanup. ! sca$report_definition_add_action_routine ( 'sca$report_cleanup_file', sca$report_k_invoke_after_each_entity); !------------------------------------------------------------------------- ! level 2 - component tags ! component_tags (built at run-time) ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! sca$report_definition_add_entry (2, 1, 2, 1); sca$report_definition_add_label ('component tags entry'); ! The variable sca$report_CSC_file_name is filled in by an action routine ! for the CSC tags entry. ! sca$report_definition_add_query_dynamic ( sca$report_k_query_component_tags + '"', 'sca$report_CSC_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); ! Action routine for after all entities - write component tag text. ! sca$report_definition_add_action_routine ( 'sca$report_do_2167a_component_tags', sca$report_k_invoke_after_all_entities); !------------------------------------------------------------------------- ! level 2 - parent csc ! parent_csc query (built at run-time) ! attribute - type TAG_NAME, location tag_name ! sca$report_definition_add_entry (2, 2, 1, 1); sca$report_definition_add_label ('parent csc entry'); ! The variable sca$report_CSC_file_name is filled in by an action routine ! for the CSC tags entry. ! sca$report_definition_add_query_dynamic ( sca$report_k_query_parent_csc + '"', 'sca$report_CSC_file_name', '"' ); sca$report_definition_add_query (sca$report_k_query_parent_keywords); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); ! Action routine for after all entities - write list of parents. ! sca$report_definition_add_action_routine ( 'sca$report_do_2167a_parent_csc', sca$report_k_invoke_after_all_entities); !------------------------------------------------------------------------- ! level 2 - subcomponent csc ! subcomponent_csc query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type SOURCE_LOCATION, location source_location ! sca$report_definition_add_entry (2, 1, 3, 2); sca$report_definition_add_label ('subcomponent csc entry'); sca$report_definition_add_option (sca$report_k_option_all_occurrences); ! The variable sca$report_CSC_component_name is filled in by a CSC action ! routine. ! sca$report_definition_add_query_dynamic ( sca$report_k_query_subcomponent_csc_1 + '"', 'sca$report_CSC_component_name', '"' + sca$report_k_query_subcomponent_csc_2); sca$report_definition_add_info (sca$report_k_info_type_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_source_file, sca$report_location_source_file); ! Action routine for before each entity - fill in ! sca$report_sub_csc_file_name for use in forming dynamic query. ! sca$report_definition_add_action_routine ( 'sca$report_setup_2167A_subcomponent_keywords', sca$report_k_invoke_before_each_entity); ! Action routine for after all entities - write subcomponent tag text. ! sca$report_definition_add_action_routine ( 'sca$report_do_2167A_subcomponents', sca$report_k_invoke_after_all_entities); !------------------------------------------------------------------------- ! level 3 - subcomponent keywords ! subcomponent_keywords query ! attribute - type TAG_NAME, location tag_name ! sca$report_definition_add_entry (3, 1, 1, 0); sca$report_definition_add_label ('subcomponent keywords entry'); ! The variable sca$report_sub_csc_file_name is set by an action routine of ! the 'subcomponent csc' entry - it is the name of the file that contains ! the current subcomponent. sca$report_definition_add_query_dynamic ( sca$report_k_query_subcomponent_keywords_1 + '"', 'sca$report_sub_csc_file_name', '"' + sca$report_k_query_subcomponent_keywords_2); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); !------------------------------------------------------------------------- ! level 2 - component i/o tag ! component_io query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (2, 1, 3, 2); sca$report_definition_add_label ('component i/o entry'); ! The variable sca$report_CSC_file_name is filled in by a CSC action ! routine - it is the file name for the current CSC. sca$report_definition_add_query_dynamic ( sca$report_k_query_component_io + '"', 'sca$report_CSC_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Input/output data'); ! Invoke before query - write header for all component sections. ! sca$report_definition_add_action_routine ( 'sca$report_start_component_sections', sca$report_k_invoke_before_query); ! Invoke after all entities - write component section. ! sca$report_definition_add_action_routine ( 'sca$report_do_component_section', sca$report_k_invoke_after_all_entities); !------------------------------------------------------------------------- ! level 2 - component algorithms tag ! component_algorithms query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (2, 1, 3, 1); sca$report_definition_add_label ('component algorithms entry'); ! The variable sca$report_CSC_file_name is filled in by a CSC action ! routine - it is the file name for the current CSC. sca$report_definition_add_query_dynamic ( sca$report_k_query_component_algorithms + '"', 'sca$report_CSC_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Algorithms'); ! Invoke after all entities - write component section. ! sca$report_definition_add_action_routine ( 'sca$report_do_component_section', sca$report_k_invoke_after_all_entities); !------------------------------------------------------------------------- ! level 2 - component error handling tag ! component_error_handling query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (2, 1, 3, 1); sca$report_definition_add_label ('component error handling entry'); ! The variable sca$report_CSC_file_name is filled in by a CSC action ! routine - it is the file name for the current CSC. sca$report_definition_add_query_dynamic ( sca$report_k_query_component_error_handling + '"', 'sca$report_CSC_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Error handling'); ! Invoke after all entities - write component section. ! sca$report_definition_add_action_routine ( 'sca$report_do_component_section', sca$report_k_invoke_after_all_entities); !------------------------------------------------------------------------- ! level 2 - component data conversion tag ! component_data_conversion query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (2, 1, 3, 1); sca$report_definition_add_label ('component data conversion entry'); ! The variable sca$report_CSC_file_name is filled in by a CSC action ! routine - it is the file name for the current CSC. sca$report_definition_add_query_dynamic ( sca$report_k_query_component_data_conversion + '"', 'sca$report_CSC_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Data conversion'); ! Invoke after all entities - write component section. ! sca$report_definition_add_action_routine ( 'sca$report_do_component_section', sca$report_k_invoke_after_all_entities); !------------------------------------------------------------------------- ! level 2 - component logic flow tag ! component_logic_flow query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (2, 1, 3, 1); sca$report_definition_add_label ('component logic flow entry'); ! The variable sca$report_CSC_file_name is filled in by a CSC action ! routine - it is the file name for the current CSC. sca$report_definition_add_query_dynamic ( sca$report_k_query_component_logic_flow + '"', 'sca$report_CSC_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Logic flow'); ! Invoke after all entities - write component section. ! sca$report_definition_add_action_routine ( 'sca$report_do_component_section', sca$report_k_invoke_after_all_entities); !------------------------------------------------------------------------- ! level 2 - component requirements tag ! component_requirements query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (2, 1, 3, 1); sca$report_definition_add_label ('component requirements entry'); ! The variable sca$report_CSC_file_name is filled in by a CSC action ! routine - it is the file name for the current CSC. sca$report_definition_add_query_dynamic ( sca$report_k_query_component_requirements + '"', 'sca$report_CSC_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Requirements Allocation'); ! Invoke after all entities - write component section. ! sca$report_definition_add_action_routine ( 'sca$report_do_component_section', sca$report_k_invoke_after_all_entities); !------------------------------------------------------------------------- ! level 2 - units ! 2167a_units query (filled in at run-time) ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type SOURCE_FILE, location source_file ! sca$report_definition_add_entry (2, 1, 3, 2); sca$report_definition_add_label ('units entry'); sca$report_definition_add_option (sca$report_k_option_all_occurrences); ! The variable sca$report_CSC_file_name is filled in by a CSC action ! routine - it is the file name for the current CSC. sca$report_definition_add_query_dynamic ( sca$report_k_query_2167a_units_1 + '"', 'sca$report_CSC_component_name', '"' + sca$report_k_query_2167a_units_2); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_source_file, sca$report_location_source_file); ! Invoke before each entity - fill in unit subqueries. ! sca$report_definition_add_action_routine ( 'sca$report_setup_unit_subqueries', sca$report_k_invoke_before_each_entity); ! Invoke after all entities - write units section. ! sca$report_definition_add_action_routine ( 'sca$report_do_2167A_units', sca$report_k_invoke_after_all_entities); !------------------------------------------------------------------------- ! level 3 - unit description ! 2167a_unit_description query (filled in at run-time) ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! sca$report_definition_add_entry (3, 1, 2, 0); sca$report_definition_add_label ('unit description entry'); ! The variable sca$report_unit_file_name is filled in by the action ! routine for the units entry - it is the file name for the current unit. sca$report_definition_add_query_dynamic ( sca$report_k_query_2167a_unit_description + '"', 'sca$report_unit_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); !------------------------------------------------------------------------- ! level 3 - unit i/o tag ! unit_io query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (3, 1, 3, 0); sca$report_definition_add_label ('unit i/o entry'); ! The variable sca$report_unit_file_name is filled in by the action ! routine for the units entry - it is the file name for the current unit. sca$report_definition_add_query_dynamic ( sca$report_k_query_2167a_unit_io + '"', 'sca$report_unit_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Input/output data elements'); !------------------------------------------------------------------------- ! level 3 - unit data tag ! unit_data query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (3, 1, 3, 0); sca$report_definition_add_label ('unit data entry'); ! The variable sca$report_unit_file_name is filled in by the action ! routine for the units entry - it is the file name for the current unit. sca$report_definition_add_query_dynamic ( sca$report_k_query_2167a_unit_data + '"', 'sca$report_unit_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Local data elements'); !------------------------------------------------------------------------- ! level 3 - unit int tag ! unit_int query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (3, 1, 3, 0); sca$report_definition_add_label ('unit int entry'); ! The variable sca$report_unit_file_name is filled in by the action ! routine for the units entry - it is the file name for the current unit. sca$report_definition_add_query_dynamic ( sca$report_k_query_2167a_unit_int + '"', 'sca$report_unit_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Interrupts and signals'); !------------------------------------------------------------------------- ! level 3 - unit alg tag ! unit_alg query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (3, 1, 3, 0); sca$report_definition_add_label ('unit alg entry'); ! The variable sca$report_unit_file_name is filled in by the action ! routine for the units entry - it is the file name for the current unit. sca$report_definition_add_query_dynamic ( sca$report_k_query_2167a_unit_alg + '"', 'sca$report_unit_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Algorithms'); !------------------------------------------------------------------------- ! level 3 - unit error tag ! unit_error query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (3, 1, 3, 0); sca$report_definition_add_label ('unit error entry'); ! The variable sca$report_unit_file_name is filled in by the action ! routine for the units entry - it is the file name for the current unit. sca$report_definition_add_query_dynamic ( sca$report_k_query_2167a_unit_error + '"', 'sca$report_unit_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Error handling'); !------------------------------------------------------------------------- ! level 3 - unit conv tag ! unit_conv query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (3, 1, 3, 0); sca$report_definition_add_label ('unit conv entry'); ! The variable sca$report_unit_file_name is filled in by the action ! routine for the units entry - it is the file name for the current unit. sca$report_definition_add_query_dynamic ( sca$report_k_query_2167a_unit_conv + '"', 'sca$report_unit_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Data conversion'); !------------------------------------------------------------------------- ! level 3 - unit other tag ! unit_other query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (3, 1, 3, 0); sca$report_definition_add_label ('unit other entry'); ! The variable sca$report_unit_file_name is filled in by the action ! routine for the units entry - it is the file name for the current unit. sca$report_definition_add_query_dynamic ( sca$report_k_query_2167a_unit_other + '"', 'sca$report_unit_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Use of other elements'); !------------------------------------------------------------------------- ! level 3 - unit logic tag ! unit_logic query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (3, 1, 3, 0); sca$report_definition_add_label ('unit logic entry'); ! The variable sca$report_unit_file_name is filled in by the action ! routine for the units entry - it is the file name for the current unit. sca$report_definition_add_query_dynamic ( sca$report_k_query_2167a_unit_logic + '"', 'sca$report_unit_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Logic flow'); !------------------------------------------------------------------------- ! level 3 - unit struct tag ! unit_struct query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (3, 1, 3, 0); sca$report_definition_add_label ('unit struct entry'); ! The variable sca$report_unit_file_name is filled in by the action ! routine for the units entry - it is the file name for the current unit. sca$report_definition_add_query_dynamic ( sca$report_k_query_2167a_unit_struct + '"', 'sca$report_unit_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Data structures'); !------------------------------------------------------------------------- ! level 3 - unit files tag ! unit_files query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (3, 1, 3, 0); sca$report_definition_add_label ('unit files entry'); ! The variable sca$report_unit_file_name is filled in by the action ! routine for the units entry - it is the file name for the current unit. sca$report_definition_add_query_dynamic ( sca$report_k_query_2167a_unit_files + '"', 'sca$report_unit_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Local data files'); !------------------------------------------------------------------------- ! level 3 - unit limits tag ! unit_limits query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (3, 1, 3, 0); sca$report_definition_add_label ('unit limits entry'); ! The variable sca$report_unit_file_name is filled in by the action ! routine for the units entry - it is the file name for the current unit. sca$report_definition_add_query_dynamic ( sca$report_k_query_2167a_unit_limits + '"', 'sca$report_unit_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Limitations'); !------------------------------------------------------------------------- ! level 3 - unit req tag ! unit_req query ! attribute - type TAG_NAME, location tag_name ! attribute - type TAG_TEXT, location tag_text ! attribute - type CONSTANT, location section_label ! sca$report_definition_add_entry (3, 1, 3, 0); sca$report_definition_add_label ('unit req entry'); ! The variable sca$report_unit_file_name is filled in by the action ! routine for the units entry - it is the file name for the current unit. sca$report_definition_add_query_dynamic ( sca$report_k_query_2167a_unit_req + '"', 'sca$report_unit_file_name', '"' ); sca$report_definition_add_info (sca$report_k_info_type_tag_name, sca$report_location_tag_name); sca$report_definition_add_info (sca$report_k_info_type_tag_text, sca$report_location_tag_text); sca$report_definition_add_info (sca$report_k_info_type_constant, sca$report_location_section_label, 'Requirements allocated'); !========================================================================= ENDPROCEDURE PROCEDURE sca$report_setup_csc_tag_query !++ ! FUNCTIONAL DESCRIPTION: ! ! This action routine builds the CSC tags query, on the basis of the result ! of the domain query for the report. It is invoked when the domain query ! is non-empty. ! ! FORMAL PARAMETERS: ! ! None !-- LOCAL CSC_tags_query, i, file_list, file_name, file_occurrence_result; ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_SETUP_CSC_TAG_QUERY'); ENDON_ERROR; ! Loop over all files in the domain. ! i := 1; file_list := ''; LOOP EXITIF i > sca$report_current_entry_result{sca$report_k_entry_number_occurrences}; file_occurrence_result := sca$report_fetch_occurrence (sca$report_current_entry_result, i); sca$report_fetch_result (file_occurrence_result, sca$report_location_file_name, file_name); file_list := file_list + '"' + file_name + '"'; IF i <> sca$report_current_entry_result{sca$report_k_entry_number_occurrences} THEN file_list := file_list + ','; ENDIF; i := i + 1; ENDLOOP; CSC_tags_query := sca$report_k_query_CSC_tags_domain_1 + file_list + sca$report_k_query_CSC_tags_domain_2; ! Fill in the CSC_tags query in the definition. ! sca$report_definition_modify_query ('CSC tags entry', CSC_tags_query, 1); ENDPROCEDURE PROCEDURE sca$report_setup_csc_nodomain_query !++ ! FUNCTIONAL DESCRIPTION: ! ! This action routine builds the CSC tags query when the domain query is ! empty. ! ! FORMAL PARAMETERS: ! ! None !-- LOCAL CSC_tags_query; ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_SETUP_CSC_NODOMAIN_QUERY'); ENDON_ERROR; ! Domain is empty or /DOMAIN was not given - issue nodomain query. ! CSC_tags_query := sca$report_k_query_CSC_tags_nodomain; ! Fill in the CSC_tags query in the definition. ! sca$report_definition_modify_query ('CSC tags entry', CSC_tags_query, 1); ENDPROCEDURE PROCEDURE sca$report_setup_csc !++ ! FUNCTIONAL DESCRIPTION: ! ! This action routine stores the name of the current CSC and the name of the ! source file that contains the CSC tag in global variables, for later use in ! forming dynamic query strings. It also writes the header for the csc. ! ! FORMAL PARAMETERS: ! ! None !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_SETUP_CSC'); ENDON_ERROR; ! Fetch the name of the source file that contains the current CSC tag, ! and the CSC name. These will be used in forming dynamic query strings ! for sub-entries of the report definition. ! The current occurrence is for the current CSC tag. ! sca$report_fetch_result (sca$report_current_occurrence_result, sca$report_location_source_file, sca$report_CSC_file_name); sca$report_fetch_result (sca$report_current_occurrence_result, sca$report_location_tag_name, sca$report_CSC_component_name); ! Write the section header for this csc. ! sca$report_start_header (1, sca$report_CSC_component_name); ENDPROCEDURE PROCEDURE sca$report_start_component_sections !++ ! FUNCTIONAL DESCRIPTION: ! ! This action routine starts the component info section, by writing the ! header text. ! ! FORMAL PARAMETERS: ! ! None !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_START_COMPONENT_SECTIONS'); ENDON_ERROR; sca$report_start_header (2, sca$report_section_component_info_section); sca$report_paragraph (''); ENDPROCEDURE PROCEDURE sca$report_do_component_section !++ ! FUNCTIONAL DESCRIPTION: ! ! This action routine writes the component info for one component. ! ! FORMAL PARAMETERS: ! ! None !-- LOCAL section_header; ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_DO_COMPONENT_SECTION'); ENDON_ERROR; component_occurrence := sca$report_fetch_occurrence (sca$report_current_entry_result, 1); sca$report_fetch_result (component_occurrence, sca$report_location_section_label, section_header); sca$report_start_header (3, section_header); sca$report_write_tags_subsection (sca$report_current_entry_result, sca$report_k_write_by_paragraphs); ENDPROCEDURE PROCEDURE sca$report_do_2167A_component_tags !++ ! FUNCTIONAL DESCRIPTION: ! ! This action routine writes the component tags for a csc. ! ! FORMAL PARAMETERS: ! ! None !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_DO_2167A_COMPONENT_TAGS'); ENDON_ERROR; sca$report_write_tags_subsection ( sca$report_current_entry_result, sca$report_k_write_by_paragraphs, sca$report_no_description); ENDPROCEDURE PROCEDURE sca$report_do_2167A_parent_csc !++ ! FUNCTIONAL DESCRIPTION: ! ! This action routine writes an unnumbered subsection that indicates the ! parents of the current component. This subsection will look like: ! ! Parent Components: ! ! This component is a sub-level component of: ! 1. Parent 1. ! 2. Parent 2. ! ... ! ! 2167A seems to allow that a given component could be a sublevel component ! of multiple parents. ! ! FORMAL PARAMETERS: ! ! None !-- LOCAL i, parent_name, parent_occurrence; ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_DO_2167A_PARENT_CSC'); ENDON_ERROR; sca$report_paragraph (''); sca$report_unnumbered_heading (sca$report_section_parent_csc); sca$report_paragraph (sca$report_parent_line); ! Write the list of parent keywords. ! sca$report_start_list (sca$report_k_list_unnumbered); i := 1; LOOP EXITIF i > sca$report_current_entry_result{sca$report_k_entry_number_occurrences}; ! Fetch parent name (keyword) and add it to list. ! parent_occurrence := sca$report_fetch_occurrence (sca$report_current_entry_result, i); sca$report_fetch_result (parent_occurrence, sca$report_location_tag_name, parent_name); sca$report_list_element (parent_name); i := i + 1; ENDLOOP; sca$report_end_list; ENDPROCEDURE PROCEDURE sca$report_setup_2167A_subcomponent_keywords !++ ! FUNCTIONAL DESCRIPTION: ! ! This action routine stores the name of the file containing the current ! subcomponent CSC tag. ! ! FORMAL PARAMETERS: ! ! None !-- LOCAL sub_csc_file; ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup ('SCA$REPORT_SETUP_2167A_SUBCOMPONENT_KEYWORDS'); ENDON_ERROR; ! Fetch the name of the file containing the current subcomponent CSC tag. ! This is used to form the dynamic query string for the 'subcomponents ! keyword' entry. ! sca$report_fetch_result (sca$report_current_occurrence_result, sca$report_location_source_file, sca$report_sub_csc_file_name); ENDPROCEDURE PROCEDURE sca$report_do_2167A_subcomponents !++ ! FUNCTIONAL DESCRIPTION: ! ! This action routine writes an unnumbered subsection that indicates the ! sublevel components of the current component. This subsection will look ! like: ! ! Sub-level Components: ! ! This component has the following sub-level components: ! 1. Sub-level component 1. ! 2. Sub-level component 2. ! ... ! ! ! FORMAL PARAMETERS: ! ! None !-- LOCAL i, keyword_entry, keyword_occurrence, sub_csc_component_entity_name, sub_csc_file_name, sub_occurrence; ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup ('SCA$REPORT_DO_2167A_SUBCOMPONENTS'); ENDON_ERROR; sca$report_paragraph (''); sca$report_unnumbered_heading (sca$report_section_sub_csc); sca$report_paragraph (sca$report_sub_line); ! Write the list of sublevel components. ! sca$report_start_list (sca$report_k_list_unnumbered); i := 1; LOOP EXITIF i > sca$report_current_entry_result{sca$report_k_entry_number_occurrences}; ! Fetch the subquery result for this subcomponent. ! sub_occurrence := sca$report_fetch_occurrence (sca$report_current_entry_result, i); keyword_entry := sca$report_fetch_entry (sub_occurrence, 'subcomponent keywords entry'); IF keyword_entry{sca$report_k_entry_number_occurrences} = 0 THEN sca$report_fetch_result (sub_occurrence, sca$report_location_source_file, sub_csc_file_name); sca$report_list_element (sub_csc_file_name); MESSAGE('Missing COMPONENT: tag in ' + sub_csc_file_name); ELSE ! Add this keyword to the list. ! keyword_occurrence := sca$report_fetch_occurrence (keyword_entry, 1); sca$report_fetch_result (keyword_occurrence, sca$report_location_tag_name, sub_csc_component_entity_name); sca$report_list_element (sub_csc_component_entity_name); ENDIF; i := i + 1; ENDLOOP; sca$report_end_list; ENDPROCEDURE PROCEDURE sca$report_setup_unit_subqueries !++ ! FUNCTIONAL DESCRIPTION: ! ! This action routine stores the file name of the current unit. ! ! FORMAL PARAMETERS: ! ! None !-- LOCAL file_name; ON_ERROR sca$report_common_error_cleanup ('SCA$REPORT_SETUP_UNIT_SUBQUERIES'); ENDON_ERROR; ! Fetch the name of the current unit (it's the current occurrence). ! This is used to form the dynamic queries for sub-entries. ! sca$report_fetch_result (sca$report_current_occurrence_result, sca$report_location_source_file, sca$report_unit_file_name); ENDPROCEDURE PROCEDURE sca$report_do_2167A_units !++ ! FUNCTIONAL DESCRIPTION: ! ! This action routine writes the Units section of a 2167A report for a ! single CSC. ! ! FORMAL PARAMETERS: ! ! None !-- LOCAL i, section_entry_result, section_occurrence_result, section_header, section_index, unit_description_entry, unit_file_name, unit_name, unit_occurrence_result; ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup ('SCA$REPORT_DO_2167A_UNITS'); ENDON_ERROR; ! Write the header for the units section. ! sca$report_start_header (2, sca$report_section_unit_section); IF sca$report_current_entry_result{sca$report_k_entry_number_occurrences} = 0 THEN sca$report_paragraph (sca$report_no_units); RETURN; ELSE ! We need to put out an empty paragraph before the first subsection of ! this section. sca$report_paragraph (''); ENDIF; i := 1; LOOP EXITIF i > sca$report_current_entry_result{sca$report_k_entry_number_occurrences}; unit_occurrence_result := sca$report_fetch_occurrence (sca$report_current_entry_result, i); sca$report_fetch_result (unit_occurrence_result, sca$report_location_source_file, unit_file_name); unit_name := FILE_PARSE(unit_file_name,'','',NAME); ! Write the unit description tags for the file this unit appears in. ! sca$report_start_header (3, unit_name); unit_description_entry := sca$report_fetch_entry (unit_occurrence_result, 'unit description entry'); sca$report_write_tags_subsection ( unit_description_entry, sca$report_k_write_by_paragraphs, sca$report_no_description); ! Write unit sections. They start with subentry 2. ! section_index := 2; LOOP section_entry_result := sca$report_fetch_entry (unit_occurrence_result, section_index); EXITIF section_entry_result = 0; EXITIF section_entry_result{sca$report_k_entry_number_occurrences} = 0; section_occurrence_result := sca$report_fetch_occurrence (section_entry_result, 1); sca$report_fetch_result (section_occurrence_result, sca$report_location_section_label, section_header); ! Write this unit section. ! sca$report_start_header (4, section_header); sca$report_write_tags_subsection ( section_entry_result, sca$report_k_write_by_paragraphs); section_index := section_index + 1; ENDLOOP; ! Get next unit. ! i := i + 1; ENDLOOP; ENDPROCEDURE ENDMODULE