MODULE sca$report_format IDENT "T4.2" !************************************************************************* ! * ! © 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 contains the routines that are responsible for the text ! formatting of reports -- obtaining chapter headings, etc. ! ! Each routine in this module is a dispatch routine that transfers control to ! an appropriate routine for the target type, based on ! SCA$REPORT_TARGET_INDEX. ! !- PROCEDURE sca$report_add_table_item ( item_name; item_description) !++ ! FUNCTIONAL DESCRIPTION: ! ! This routine adds an item to a table. See sca$report_start_table ! for an explanation of tables. ! ! FORMAL PARAMETERS: ! ! item_name ! ! The name of the item. This should be a TPU string or range value. IN ! parameter. ! ! item_description ! ! The description of the item. This should be a TPU string or range ! value. IN parameter. ! ! IMPLICIT INPUTS: ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_ADD_TABLE_ITEM'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_add_table_item_runoff (item_name, item_description); [sca$report_k_target_document] : sca$report_add_table_item_document (item_name, item_description); [sca$report_k_target_text] : sca$report_add_table_item_runoff (item_name, item_description); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_appendix (appendix_title) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure creates a new appendix. ! ! FORMAL PARAMETERS: ! ! appendix_title ! ! The title of the appendix. This should be a TPU string value. IN ! parameter. ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_APPENDIX'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_appendix_runoff (appendix_title); [sca$report_k_target_document] : sca$report_appendix_document (appendix_title); [sca$report_k_target_text] : sca$report_appendix_runoff (appendix_title); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_bad_target (target_index) !++ ! FUNCTIONAL DESCRIPTION: ! ! Report a bad target error. This happens when the target index passed to ! a formatting routine is not supported. ! ! FORMAL PARAMETERS: ! ! target_index ! ! The bad target index, as an integer. IN parameter. !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_BAD_TARGET'); ENDON_ERROR; sca$report_hard_error (MESSAGE_TEXT(sca$_badtarget,0) + ' (' + STR(target_index) + ')' ); ENDPROCEDURE PROCEDURE sca$report_chapter (chapter_title, decl_class) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure creates a new chapter. ! ! FORMAL PARAMETERS: ! ! chapter_title ! ! The title of the chapter, as a TPU string value. IN parameter. ! ! decl_class ! ! The declaration class of the object that the chapter describes, as a ! TPU string value. IN parameter. !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_CHAPTER'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_chapter_runoff (chapter_title, decl_class); [sca$report_k_target_document] : sca$report_chapter_document (chapter_title, decl_class); [sca$report_k_target_text] : sca$report_chapter_runoff (chapter_title, decl_class); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_end_fragment !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure produces the formatting commands needed to end a code ! fragment. ! ! FORMAL PARAMETERS: ! ! None ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_END_FRAGMENT'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_end_fragment_runoff; [sca$report_k_target_document] : sca$report_end_fragment_document; [sca$report_k_target_text] : sca$report_end_fragment_runoff; [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_end_list !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure produces the formatting commands needed to end a list. ! ! FORMAL PARAMETERS: ! ! None ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_END_LIST'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_end_list_runoff; [sca$report_k_target_document] : sca$report_end_list_document; [sca$report_k_target_text] : sca$report_end_list_runoff; [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_end_parameter_section !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for ending ! the description of the parameter list in a routine section. ! ! FORMAL PARAMETERS: ! ! None ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_END_PARAMETER_SECTION'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_end_parameter_section_runoff; [sca$report_k_target_document] : sca$report_end_parameter_section_document; [sca$report_k_target_text] : sca$report_end_parameter_section_runoff; [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_end_routine_section (;routine_name) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for ending ! a routine section. ! ! FORMAL PARAMETERS: ! ! routine_name ! ! The name of the routine currently being processed. This should be ! a TPU string value. Optional IN parameter. ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_END_ROUTINE_SECTION'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_end_routine_section_runoff (routine_name); [sca$report_k_target_document] : sca$report_end_routine_section_document (routine_name); [sca$report_k_target_text] : sca$report_end_routine_section_runoff (routine_name); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_end_routine_subsection !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for ending ! a subsection of a routine section. ! ! FORMAL PARAMETERS: ! ! None ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_END_ROUTINE_SUBSECTION'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_end_routine_subsection_runoff; [sca$report_k_target_document] : sca$report_end_routine_subsection_document; [sca$report_k_target_text] : sca$report_end_routine_subsection_runoff; [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_end_section !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for ending ! a section. ! ! FORMAL PARAMETERS: ! ! None ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_END_SECTION'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_end_section_runoff; [sca$report_k_target_document] : sca$report_end_section_document; [sca$report_k_target_text] : sca$report_end_section_runoff; [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_end_subsection !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for ending ! a subsection. ! ! FORMAL PARAMETERS: ! ! None ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_END_SUBSECTION'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_end_subsection_runoff; [sca$report_k_target_document] : sca$report_end_subsection_document; [sca$report_k_target_text] : sca$report_end_subsection_runoff; [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_end_table !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for ending a ! table. ! ! FORMAL PARAMETERS: ! ! None ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_END_TABLE'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_end_table_runoff; [sca$report_k_target_document] : sca$report_end_table_document; [sca$report_k_target_text] : sca$report_end_table_runoff; [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_format_tag (tag_value_range) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure does target-specific formatting of the text associated with ! a tag. Currently, target-specific formatting is only done for DOCUMENT. ! ! FORMAL PARAMETERS: ! ! tag_value_range ! ! The text of the tag value, as a TPU range. IN parameter. ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('sca$report_format_tag'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_document] : sca$report_format_tag_document (tag_value_range); [INRANGE] : RETURN; [OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_include_file(file_name) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out an include command to include a separate file ! into the report. ! ! FORMAL PARAMETERS: ! ! file_name ! ! The name of the file to include. This should be a TPU string. ! IN parameter. ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_INCLUDE_FILE'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_include_file_runoff (file_name); [sca$report_k_target_document] : sca$report_include_file_document (file_name); [sca$report_k_target_text] : sca$report_include_file_runoff (file_name); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_list_element (element_text) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes a single element in a list. ! ! FORMAL PARAMETERS: ! ! element_text ! ! The text to write for the element. This should be a TPU string. ! IN parameter. !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_LIST_ELEMENT'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_list_element_runoff (element_text); [sca$report_k_target_document] : sca$report_list_element_document (element_text); [sca$report_k_target_text] : sca$report_list_element_runoff (element_text); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_paragraph (text_block ;initial_paragraph) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes a paragraph to the output buffer. ! ! FORMAL PARAMETERS: ! ! text_block ! ! The text of the paragraph. This should be a TPU range variable. IN ! parameter. ! ! initial_paragraph ! ! A boolean flag which indicates that the initial paragraph tag should ! not be written. TRUE or unspecified indicates to write the new ! paragraph tag. FALSE indicates not to write the new paragraph tag. ! Optional IN parameter. !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_PARAGRAPH'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_paragraph_runoff (text_block, initial_paragraph); [sca$report_k_target_document] : sca$report_paragraph_document (text_block, initial_paragraph); [sca$report_k_target_text] : sca$report_paragraph_runoff (text_block, initial_paragraph); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_placeholder (placeholder_name) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes a placeholder to the output file. ! ! FORMAL PARAMETERS: ! ! placeholder_name ! ! The name of the placeholder. This should be a string value. ! Placeholder brackets should not be included on the string, since they ! can vary depending on the target. IN parameter. !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_PLACEHOLDER'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_placeholder_runoff; [sca$report_k_target_document] : sca$report_placeholder_document; [sca$report_k_target_text] : sca$report_placeholder_runoff; [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_post_process !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure performs post processing on the output file. ! ! FORMAL PARAMETERS: ! ! None !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_POST_PROCESS'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_text] : sca$report_post_process_text; [INRANGE, OUTRANGE] : sca$report_post_process_default; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_post_process_default !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure performs end-of-report processing for all targets that don't ! require anything target-specific. ! ! FORMAL PARAMETERS: ! ! None !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_POST_PROCESS_DEFAULT'); ENDON_ERROR; MESSAGE (''); IF sca$report_work_file_spec <> '' THEN MESSAGE ('Report written to file ' + sca$report_work_file_spec); ELSE MESSAGE ('Empty report - no output file written'); ENDIF; MESSAGE (''); RETURN; ENDPROCEDURE PROCEDURE sca$report_start_2167a_design !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for producing ! a 2167A software design document. ! ! FORMAL PARAMETERS: ! ! None !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_START_2167A_DESIGN'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_start_2167A_design_runoff; [sca$report_k_target_document] : sca$report_start_2167A_design_document; [sca$report_k_target_text] : sca$report_start_2167A_design_runoff; [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_start_fragment (fragment_number, id_text_size) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for starting ! a code fragment. ! ! FORMAL PARAMETERS: ! ! fragment_number ! ! The number to assign to the fragment, as a TPU integer value. IN ! parameter. ! ! id_text_size ! ! The number of columns required to display the fragment number. OUT ! parameter. ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_START_FRAGMENT'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_start_fragment_runoff (fragment_number, id_text_size); [sca$report_k_target_document] : sca$report_start_fragment_document (fragment_number, id_text_size); [sca$report_k_target_text] : sca$report_start_fragment_runoff (fragment_number, id_text_size); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_start_header (level, section_title) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for starting ! a section at a given level. This corresponds to the Runoff .HEADER LEVEL ! command and the Document tags. ! ! FORMAL PARAMETERS: ! ! level ! ! The level for the header. This should be an integer value. IN ! parameter. !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_START_HEADER'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_start_header_runoff (level, section_title); [sca$report_k_target_document] : sca$report_start_header_document (level, section_title); [sca$report_k_target_text] : sca$report_start_header_runoff (level, section_title); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_start_list (;list_style) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure produces the formatting commands needed to start a list. ! Lists are numbered sequences, such as by Document's tag or Runoff's ! .LIST directive. ! ! FORMAL PARAMETERS: ! ! list_style ! ! A constant that indicates the type of list to be used. ! Optional IN parameter. !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_START_LIST'); ENDON_ERROR; ! If no list style was passed to the procedure, then use the current value ! of the symbol sca$report_option_list_style. ! IF list_style = tpu$k_unspecified THEN list_style := sca$report_option_list_style; ENDIF; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_start_list_runoff (list_style); [sca$report_k_target_document] : sca$report_start_list_document (list_style); [sca$report_k_target_text] : sca$report_start_list_runoff (list_style); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_start_parameter (parameter_name) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for starting ! the description of a single parameter in the parameter list description of ! a routine section. ! ! FORMAL PARAMETERS: ! ! parameter_name ! ! The name of the parameter, as a TPU string. IN parameter. ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_START_PARAMETER'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_start_parameter_runoff (parameter_name); [sca$report_k_target_document] : sca$report_start_parameter_document (parameter_name); [sca$report_k_target_text] : sca$report_start_parameter_runoff (parameter_name); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_start_parameter_section !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for starting ! the description of the parameter list in a routine section. ! ! FORMAL PARAMETERS: ! ! None ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_START_PARAMETER_SECTION'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_start_parameter_section_runoff; [sca$report_k_target_document] : sca$report_start_parameter_section_document; [sca$report_k_target_text] : sca$report_start_parameter_section_runoff; [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_start_routine_section (module_name, routine_name, routine_decl_class) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for starting ! a routine section. ! ! FORMAL PARAMETERS: ! ! module_name ! ! The name of the module containing the routine, as a TPU string. IN ! parameter. ! ! routine_name ! ! The name of the routine, as a TPU string. IN parameter. ! ! routine_decl_class ! ! The declaration class of the routine, as a TPU string. IN parameter. !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_START_ROUTINE_SECTION'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_start_routine_section_runoff ( module_name, routine_name, routine_decl_class); [sca$report_k_target_document] : sca$report_start_routine_section_document ( module_name, routine_name, routine_decl_class); [sca$report_k_target_text] : sca$report_start_routine_section_runoff ( module_name, routine_name, routine_decl_class); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_start_routine_subsection (heading) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for starting ! an arbitrary subsection of a routine section. ! ! FORMAL PARAMETERS: ! ! heading ! ! The heading to use for the subsection, as a TPU string. ! IN parameter. !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_START_ROUTINE_SUBSECTION'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_start_routine_subsection_runoff (heading); [sca$report_k_target_document] : sca$report_start_routine_subsection_document (heading); [sca$report_k_target_text] : sca$report_start_routine_subsection_runoff (heading); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_start_section (section_title) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for starting ! a section. ! ! FORMAL PARAMETERS: ! ! section_title ! ! The title to use for the section, as a TPU string. IN parameter. !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_START_SECTION'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_start_section_runoff (section_title); [sca$report_k_target_document] : sca$report_start_section_document (section_title); [sca$report_k_target_text] : sca$report_start_section_runoff (section_title); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_start_subsection (subsection_title) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for starting ! a subsection. ! ! FORMAL PARAMETERS: ! ! subsection_title ! ! The title to use for the subsection, as a TPU string. IN parameter. ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_START_SUBSECTION'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_start_subsection_runoff (subsection_title); [sca$report_k_target_document] : sca$report_start_subsection_document (subsection_title); [sca$report_k_target_text] : sca$report_start_subsection_runoff (subsection_title); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_start_software_specification !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for producing ! a software specification document. ! ! We borrow the term "software specification" from VAX Document, and in fact, ! use that format for SDML output. For other forms of output, we do our best ! to produce a document that appears similar. ! ! FORMAL PARAMETERS: ! ! None !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_START_SOFTWARE_SPECIFICATION'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_start_software_specification_runoff; [sca$report_k_target_document] : sca$report_start_software_specification_document; [sca$report_k_target_text] : sca$report_start_software_specification_runoff; [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_start_table (heading) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the formatting information necessary for starting ! a table. ! ! ! FORMAL PARAMETERS: ! ! heading ! ! The heading to use for the table, as a TPU string. IN parameter !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_START_TABLE'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_start_table_runoff (heading); [sca$report_k_target_document] : sca$report_start_table_document (heading); [sca$report_k_target_text] : sca$report_start_table_runoff (heading); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_unnumbered_heading(heading_text) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes an unnumbered heading. ! ! FORMAL PARAMETERS: ! ! heading_text ! ! The text of the heading, as a TPU string. IN parameter. !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_UNNUMBERED_HEADING'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_unnumbered_heading_runoff (heading_text); [sca$report_k_target_document] : sca$report_unnumbered_heading_document (heading_text); [sca$report_k_target_text] : sca$report_unnumbered_heading_runoff (heading_text); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_write_code_fragment(fragment, id_text_size, subfragment_number, lowest_level) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out a code fragment. ! ! Since code fragments are always written verbatim, we don't need to dispatch ! to a target dependent routine. ! ! FORMAL PARAMETERS: ! ! fragment ! ! The fragment to write, as a range. IN parameter. ! ! id_text_size ! ! The number of columns required to display the fragment number. IN ! parameter. ! ! subfragment_number ! ! The current subfragment number (last used cross reference number). ! IN OUT parameter. ! ! lowest_level ! ! TRUE if the current fragment is at the lowest level of detail to be ! displayed. IN parameter. !-- LOCAL here, is_first, line, margin_amount, new_line, saved_position; ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_WRITE_CODE_FRAGMENT'); ENDON_ERROR; saved_position := MARK(FREE_CURSOR); ! Move down to the first visible line within the group (the input range may ! include the overview line for the range). ! POSITION(BEGINNING_OF(fragment)); IF NOT lse$is_visible THEN MOVE_VERTICAL(1); ENDIF; ! Determine where the left margin should be. ! sca$report_get_left_margin (fragment, id_text_size, margin_amount); ! Copy visible lines in the fragment to the output buffer, stripping off ! enough space at the beginning of each line to shift the entire fragment ! over to the left. ! Mark overview lines for cross-referencing. ! is_first := 1; LOOP EXITIF MARK(FREE_CURSOR) >= END_OF(fragment); IF is_first THEN sca$report_strip_left_margin ( CURRENT_LINE, margin_amount + id_text_size, new_line); is_first := 0; ELSE sca$report_strip_left_margin ( CURRENT_LINE, margin_amount, new_line); ENDIF; IF new_line <> '' THEN sca$report_append_text (new_line, TRUE); ELSE sca$report_blank_line; ENDIF; IF lse$is_overview AND (NOT lowest_level) THEN subfragment_number := subfragment_number + 1; sca$remember_overview_line; ENDIF; lse$move_vertical(1); ENDLOOP; ! Clean up and return. ! POSITION(saved_position); RETURN; ENDPROCEDURE PROCEDURE sca$remember_overview_line !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure puts a marker on the end of the last line of the buffer. ! ! FORMAL PARAMETERS: ! ! None !-- LOCAL mark_number, save_position; ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REMEMBER_OVERVIEW_LINE'); ENDON_ERROR; save_position := MARK(NONE); mark_number := GET_INFO(save_position,"record_number"); ! Put a marker on the end of the last line written to the output buffer. ! POSITION(sca$report_output_buffer); MOVE_HORIZONTAL(-1); IF sca$report_mark_array = TPU$K_UNSPECIFIED THEN sca$report_mark_array := CREATE_ARRAY(1000,0); ENDIF; sca$report_mark_array{mark_number} := Mark(None); MOVE_HORIZONTAL(1); POSITION(save_position); ENDPROCEDURE; PROCEDURE sca$report_write_cross_reference (fragment_number, overview_mark) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes a cross reference number at the end of a previously ! written overview line. ! ! FORMAL PARAMETERS: ! ! fragment_number ! ! The cross reference number to write. ! ! overview_mark ! ! A mark on the overview line that represents the fragment being referred ! to. ! ! IMPLICIT INPUTS: ! ! The current cursor position is assumed to be on the overview line in the ! source buffer that the cross reference number applies to. !-- LOCAL mark_number, saved_position, saved_position_output; ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_WRITE_CROSS_REFERENCE'); ENDON_ERROR; ! We don't write a cross-reference number for fragment 1. It is the "main" ! fragment, so no other fragment refers to it. ! IF fragment_number = 1 THEN RETURN; ENDIF; saved_position := MARK(FREE_CURSOR); POSITION(overview_mark); mark_number := GET_INFO(mark(none),"record_number"); POSITION(sca$report_output_buffer); saved_position_output := MARK(FREE_CURSOR); ! Position to the mark. ! POSITION( sca$report_mark_array{mark_number} ); ! Add the cross reference number. How this is done is target-dependent. ! CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_write_cross_reference_runoff(fragment_number); [sca$report_k_target_document] : sca$report_write_cross_reference_document(fragment_number); [sca$report_k_target_text] : sca$report_write_cross_reference_runoff(fragment_number); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ! Delete the mark. ! DELETE( sca$report_mark_array{mark_number} ); ! Restore the output buffer position ! POSITION(saved_position_output); ! Restore the position that was current when the routine was called. ! POSITION(saved_position); RETURN ENDPROCEDURE; PROCEDURE sca$report_write_line_break !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out any necessary formating commands to get a line ! break. ! ! FORMAL PARAMETERS: ! ! None ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_WRITE_LINE_BREAK'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_write_line_break_runoff; [sca$report_k_target_document] : sca$report_write_line_break_document; [sca$report_k_target_text] : sca$report_write_line_break_runoff; [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_write_parameter_description (parameter_entry_result) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the description of a parameter. ! ! FORMAL PARAMETERS: ! ! parameter_entry_result ! ! The entry result containing the text of the parameter description. IN ! parameter. ! !-- LOCAL i, occurrence_result, parameter_description; ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_WRITE_PARAMETER_DESCRIPTION'); ENDON_ERROR; ! Check for empty description. ! IF parameter_entry_result{sca$report_k_entry_number_occurrences} = 0 THEN RETURN; ENDIF; i := 1; LOOP EXITIF i > parameter_entry_result{sca$report_k_entry_number_occurrences}; occurrence_result := sca$report_fetch_occurrence (parameter_entry_result, i); sca$report_fetch_result (occurrence_result, sca$report_location_tag_text, parameter_description); CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_write_parameter_description_runoff ( parameter_description); [sca$report_k_target_document] : sca$report_write_parameter_description_document ( parameter_description); [sca$report_k_target_text] : sca$report_write_parameter_description_runoff ( parameter_description); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; i := i + 1; ENDLOOP; ENDPROCEDURE PROCEDURE sca$report_write_return_value (routine_type, return_value) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the return value portion of the routine section. ! ! FORMAL PARAMETERS: ! ! routine_type ! ! The type of the routine, as a TPU string. IN parameter. ! ! return_value ! ! A description of the return value, as a TPU range. IN parameter. ! !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_WRITE_RETURN_VALUE'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_write_return_value_runoff (routine_type, return_value); [sca$report_k_target_document] : sca$report_write_return_value_document (routine_type, return_value); [sca$report_k_target_text] : sca$report_write_return_value_runoff (routine_type, return_value); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_write_routine_format (routine_name, routine_type, parameter_names) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes the Format section of the routine description. This ! section shows the calling sequence for the routine. ! ! FORMAL PARAMETERS: ! ! routine_name ! ! The name of the routine, as a string. IN parameter. ! ! routine_type ! ! The type of the routine return value (or '' if it has no return value), ! as a string. IN parameter. ! ! parameter_names ! ! The names of the parameters of the routine, as an array of strings, or ! 0 if the routine has no parameters. IN parameter. !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_WRITE_ROUTINE_FORMAT'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_write_routine_format_runoff ( routine_name, routine_type, parameter_names); [sca$report_k_target_document] : sca$report_write_routine_format_document ( routine_name, routine_type, parameter_names); [sca$report_k_target_text] : sca$report_write_routine_format_runoff ( routine_name, routine_type, parameter_names); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE PROCEDURE sca$report_write_routine_remark (remark_string) !++ ! FUNCTIONAL DESCRIPTION: ! ! This procedure writes out the remark string of a routine in a routine ! section. ! ! FORMAL PARAMETERS: ! ! routine_remark ! ! The remark string of the routine. !-- ON_ERROR [OTHERWISE] : sca$report_common_error_cleanup('SCA$REPORT_WRITE_ROUTINE_REMARK'); ENDON_ERROR; CASE sca$report_target_index FROM sca$report_k_first_target_index TO sca$report_k_last_target_index [sca$report_k_target_runoff] : sca$report_write_routine_remark_runoff (remark_string); [sca$report_k_target_document] : sca$report_write_routine_remark_document (remark_string); [sca$report_k_target_text] : sca$report_write_routine_remark_runoff (remark_string); [INRANGE, OUTRANGE] : sca$report_bad_target (sca$report_target_index); RETURN; ENDCASE; ENDPROCEDURE ENDMODULE