Module Cobol_config

This library is used to build configurations, either from file or from a dialect. All the from_ functions will fail if a file is not found, or use the default value of any options that is badly typed in the configuration file or not set in the configuration file.

module Types : sig ... end

Module containing most of the types definitions used in Cobol_config.

include module type of Types
type doc = Pretty.simple
type 'a feature = 'a Cobol_dialect.Types.feature
type 'a feature_support = 'a Cobol_dialect.Types.binding
type 'a value = 'a Types.value = {
  1. name : string;
  2. doc : doc;
  3. parse : string -> 'a;
}

Definition of a valued option.

module Value = Types.Value
type defaultbyte = Types.defaultbyte =
  1. | Char of char
  2. | Init
  3. | None
type standard = Types.standard =
  1. | GnuCOBOL
  2. | MicroFocus
  3. | IBM
  4. | MVS
  5. | BS2000
  6. | ACU
  7. | RM
  8. | STD85
  9. | STD2002
  10. | STD2014
type source_format = Cobol_common.Platform.TYPES.source_format_id =
  1. | SFFree
  2. | SFFixed
  3. | SFCOBOL85
  4. | SFVariable
  5. | SFXOpen
  6. | SFxCard
  7. | SFCRT
  8. | SFTrm
  9. | SFCOBOLX
type source_format_spec = Types.source_format_spec =
  1. | Auto
  2. | SF of source_format
type binary_size = Types.binary_size =
  1. | B_2_4_8
  2. | B_1_2_4_8
  3. | B_1__8
type binary_byteorder = Types.binary_byteorder =
  1. | Native
  2. | Big_endian
type assign_clause = Types.assign_clause =
  1. | Dynamic
  2. | External
  3. | IBM
  4. | MF
type screen_section_rules = Types.screen_section_rules =
  1. | ACU
  2. | GC
  3. | MF
  4. | RM
  5. | STD
  6. | XOPEN
type dpc_in_data = Types.dpc_in_data =
  1. | None
  2. | XML
  3. | Json
  4. | All
type words_spec = (string * word_spec) list
and word_spec = Types.word_spec =
  1. | ReserveWord of {
    1. preserve_context_sensitivity : bool;
    }
  2. | ReserveAlias of {
    1. alias_for : string;
    2. preserve_context_sensitivity : bool;
    }
  3. | NotReserved
type t = Types.t = {
  1. origin : Cobol_dialect.Types.origin;
  2. tab_stops : int list;
  3. comment_paragraphs : unit feature_support;
  4. safe_partial_replacing_when_src_literal : [ `Safe | `Unsafe ] feature_support;
  5. words : words_spec;
  6. intrinsic_functions : EzCompat.StringSet.t;
  7. system_names : EzCompat.StringSet.t;
  8. registers : EzCompat.StringSet.t;
  9. text_column : int;
  10. pic_length : int;
  11. word_length : int;
  12. literal_length : int;
  13. numeric_literal_length : int;
  14. defaultbyte : defaultbyte;
  15. standard_define : standard;
  16. format : source_format_spec;
  17. binary_size : binary_size;
  18. binary_byteorder : binary_byteorder;
  19. assign_clause : assign_clause;
  20. screen_section_rules : screen_section_rules;
  21. dpc_in_data : dpc_in_data;
  22. filename_mapping : bool;
  23. pretty_display : bool;
  24. binary_truncate : bool;
  25. complex_odo : bool;
  26. odoslide : bool;
  27. indirect_redefines : bool;
  28. relax_syntax_checks : bool;
  29. ref_mod_zero_length : bool;
  30. relax_level_hierarchy : bool;
  31. select_working : bool;
  32. local_implies_recursive : bool;
  33. sticky_linkage : bool;
  34. move_ibm : bool;
  35. perform_osvs : bool;
  36. arithmetic_osvs : bool;
  37. hostsign : bool;
  38. program_name_redefinition : bool;
  39. accept_update : bool;
  40. accept_auto : bool;
  41. console_is_crt : bool;
  42. no_echo_means_secure : bool;
  43. line_col_zero_default : bool;
  44. display_special_fig_consts : bool;
  45. binary_comp_1 : bool;
  46. numeric_pointer : bool;
  47. move_non_numeric_lit_to_numeric_is_zero : bool;
  48. implicit_assign_dynamic_var : bool;
  49. device_mnemonics : bool;
  50. xml_parse_xmlss : bool;
  51. areacheck : bool;
  52. ebcdic_symbolic_characters : bool;
  53. control_division : unit feature_support;
  54. memory_size_clause : unit feature_support;
  55. multiple_file_tape_clause : unit feature_support;
  56. label_records_clause : unit feature_support;
  57. value_of_clause : unit feature_support;
  58. data_records_clause : unit feature_support;
  59. top_level_occurs_clause : unit feature_support;
  60. same_as_clause : unit feature_support;
  61. type_to_clause : unit feature_support;
  62. usage_type : unit feature_support;
  63. synchronized_clause : unit feature_support;
  64. sync_left_right : unit feature_support;
  65. special_names_clause : unit feature_support;
  66. goto_statement_without_name : unit feature_support;
  67. stop_literal_statement : unit feature_support;
  68. stop_identifier_statement : unit feature_support;
  69. stop_error_statement : unit feature_support;
  70. debugging_mode : unit feature_support;
  71. use_for_debugging : unit feature_support;
  72. padding_character_clause : unit feature_support;
  73. next_sentence_phrase : unit feature_support;
  74. listing_statements : unit feature_support;
  75. title_statement : unit feature_support;
  76. entry_statement : unit feature_support;
  77. move_noninteger_to_alphanumeric : unit feature_support;
  78. move_figurative_constant_to_numeric : unit feature_support;
  79. move_figurative_space_to_numeric : unit feature_support;
  80. move_figurative_quote_to_numeric : unit feature_support;
  81. odo_without_to : unit feature_support;
  82. section_segments : unit feature_support;
  83. alter_statement : unit feature_support;
  84. call_overflow : unit feature_support;
  85. numeric_boolean : unit feature_support;
  86. hexadecimal_boolean : unit feature_support;
  87. national_literals : unit feature_support;
  88. hexadecimal_national_literals : unit feature_support;
  89. national_character_literals : unit feature_support;
  90. hp_octal_literals : unit feature_support;
  91. acu_literals : unit feature_support;
  92. word_continuation : unit feature_support;
  93. not_exception_before_exception : unit feature_support;
  94. accept_display_extensions : unit feature_support;
  95. larger_redefines : unit feature_support;
  96. symbolic_constant : unit feature_support;
  97. constant_78 : unit feature_support;
  98. constant_01 : unit feature_support;
  99. perform_varying_without_by : unit feature_support;
  100. reference_out_of_declaratives : unit feature_support;
  101. program_prototypes : unit feature_support;
  102. call_convention_mnemonic : unit feature_support;
  103. call_convention_linkage : unit feature_support;
  104. numeric_value_for_edited_item : unit feature_support;
  105. incorrect_conf_sec_order : unit feature_support;
  106. define_constant_directive : unit feature_support;
  107. free_redefines_position : unit feature_support;
  108. records_mismatch_record_clause : unit feature_support;
  109. record_delimiter : unit feature_support;
  110. sequential_delimiters : unit feature_support;
  111. record_delim_with_fixed_recs : unit feature_support;
  112. missing_statement : unit feature_support;
  113. missing_period : unit feature_support;
  114. zero_length_literals : unit feature_support;
  115. xml_generate_extra_phrases : unit feature_support;
  116. continue_after : unit feature_support;
  117. goto_entry : unit feature_support;
  118. assign_variable : unit feature_support;
  119. assign_using_variable : unit feature_support;
  120. assign_ext_dyn : unit feature_support;
  121. assign_disk_from : unit feature_support;
  122. vsam_status : unit feature_support;
  123. self_call_recursive : unit feature_support;
  124. record_contains_depending_clause : unit feature_support;
  125. picture_l : unit feature_support;
  126. alphanumeric_comp_x_over_8_chars : unit feature_support;
}
module Options : sig ... end
module Default : sig ... end
module Diagnostics : sig ... end
exception ERROR of Diagnostics.error
val default : t
val default_search_path : platform:Cobol_common.Platform.TYPES.platform -> string list

default_search_path ~platform is where configuration files are looked up after any search path given to the functions below: the current working directory, $COB_CONFIG_DIR, $XDG_CONFIG_HOME/superbol/gnucobol-config, some system-specific directories, and $COB_CONFIG_DIR_FALLBACK, as platform gives them.

The functions below access the file system and the environment through platform only, so that what they read may be recorded.

val from_file : platform:Cobol_common.Platform.TYPES.platform -> ?search_path:string list -> ?verbose:bool -> string -> t Cobol_common.Diagnostics.with_diags

from_file ~platform ~search_path filename loads a configuration from filename, looked up in its directory, then search_path, then default_search_path. Files it includes are looked up likewise, starting with the directory of the file found.

val from_dialect : platform:Cobol_common.Platform.TYPES.platform -> ?search_path:string list -> ?verbose:bool -> Cobol_dialect.Types.id -> t Cobol_common.Diagnostics.with_diags

from_dialect ~platform ~search_path dialect returns the configuration module according to the dialect defaults, looking its file up as from_file does.

val dialect : t -> Cobol_dialect.Types.id