Cobol_unit.TypesRepresentation of COBOL compilation units
A type to manage sets of items in both named and ordered form. Note that in many cases anonymous elements of list do not appear in named.
type display_sign = {sign_position : sign_position;relevant for non-binary representations
*)sign_separate : bool;true = separate character (extra byte)
}type unit_config = {unit_currency_signs : Cobol_common.Basics.CharSet.t;unit_decimal_point : char;unit_display_sign_config : Cobol_data.Types.display_sign_config;}Corresponds to the contents of the CONFIGURATION SECTION.
type data_definitions = {data_items : Cobol_data.Types.data_definition named_n_ordered;data_records : Cobol_data.Types.record list;}data_definitions exposes two views on the items (fields and tables) in DATA DIVISION:
data_items contains all the items with direct access by name.data_records is a list of record trees where each element represents a record definition (typically a level 01 or 77 data item)type paragraph = {paragraph_name : Cobol_ptree.procedure_name Cobol_common.Srcloc.TYPES.with_loc
option;None for the unnamed paragraph at the begining of a section. Some qn where qn is fully qualified otherwise. Note that paragraph_name is different than paragraph_name in Cobol_ptree.paragraph. For an unnamed paragraph at the begining of a section Cobol_ptree.paragraph contains the (optionnal) section name whereas this paragraph_name contains None to indicate that the paragraph is anonymous.
paragraph_sentences : Cobol_procedure.Types.statements
Cobol_common.Srcloc.TYPES.with_loc
list;}type section = {section_name : Cobol_ptree.name Cobol_common.Srcloc.TYPES.with_loc option;None for the unnamed section at the begining of PROCEDURE DIVISION For convenience when collecting references to all procedure names, section_name is visited as a procedure_name with_loc option.
section_segment : Cobol_data.Types.integer_value option;Optional segment priority number (obsolete in COBOL-85)
*)section_paragraphs : paragraph Cobol_common.Srcloc.TYPES.with_loc
named_n_ordered;Includes an anonymous empty paragraph if the section is empty. However, this list does not start with an unnamed paragraph, when the section immediately starts with a paragraph name.
*)}type procedure_block = | Paragraph of paragraph Cobol_common.Srcloc.TYPES.with_loc| Section of section Cobol_common.Srcloc.TYPES.with_loctype procedure_using =
Cobol_procedure.Types.procedure_arg Cobol_common.Srcloc.TYPES.with_loc listtype procedure = {procedure_using : procedure_using Cobol_common.Srcloc.TYPES.with_loc option;PROCEDURE DIVISION USING ...
*)procedure_sections : section Cobol_common.Srcloc.TYPES.with_loc list;procedure_blocks : procedure_block
Cobol_unit__.Unit_resolver_map.TYPES.resolver_map;}type cobol_unit = {unit_name : string Cobol_common.Srcloc.TYPES.with_loc;unit_parent_name : string Cobol_common.Srcloc.TYPES.with_loc option;unit_env : unit_env;unit_data : data_definitions;unit_procedure : procedure;}Type of a main COBOL compilation unit
val block_name :
procedure_block ->
Cobol_ptree.qualname Cobol_common.Srcloc.TYPES.with_loc option