Module Cobol_preproc.Env

Environment for preprocessing and compilation. Holds definitions of preprocessor constants (preprocessor DEFINES, computation process variables), along with compilation variables (78-level constants).

Accepted values for these preprocessor variables are:

For now, the set of values for compilation variables is equivalent to that of preprocessor variables.

module VAL = Cobol_data.Value
module VAR : sig ... end

Utility module that maps any string to a physically unique upper-cased internal representation.

module MAP : sig ... end
module TYPES : sig ... end
include module type of struct include TYPES end
type env = TYPES.env = {
  1. preproc_vars : preproc_var_definition MAP.t;
  2. compil_vars : compilation_var_definition MAP.t;
}
and var = VAR.t
and compilation_variable_definition = TYPES.compilation_variable_definition = {
  1. compvar : var;
  2. compvar_value : value Cobol_common.Srcloc.TYPES.with_src;
}
type var_definition = TYPES.var_definition =
  1. | Preproc_var of preproc_var_definition
  2. | Compilation_var of compilation_var_definition
type lookup_error = TYPES.lookup_error =
  1. | Undefined
exception REDEFINITION of {
  1. prev_def_src : Cobol_common.Srcloc.TYPES.src;
}
type t = env
val pp_value : Stdlib.Format.formatter -> value -> unit
val pp_compilation_variable_definition : Stdlib.Format.formatter -> compilation_variable_definition -> unit
val pp : t Pretty.printer
val empty : env
val var : string -> var
val mem_preproc_var : MAP.key -> env -> bool
val mem_preproc_var' : MAP.key Cobol_common__Srcloc.TYPES.with_loc -> env -> bool
val mem_compil_var : MAP.key -> env -> bool
val mem_compil_var' : MAP.key Cobol_common__Srcloc.TYPES.with_loc -> env -> bool
val mem_var : MAP.key -> env -> bool
val mem_var' : MAP.key Cobol_common__Srcloc.TYPES.with_loc -> env -> bool
val var_definition_of : var:MAP.key Cobol_common__Srcloc.TYPES.with_loc -> ?try_compil_vars:bool -> env -> (var_definition, lookup_error) Stdlib.result
val define_preproc_var : loc:Cobol_common.Srcloc.TYPES.srcloc -> MAP.key Cobol_common__Srcloc.TYPES.with_loc -> value Cobol_common.Srcloc.TYPES.with_src -> ?override:bool -> t -> t * preproc_var_definition
val undefine_preproc_var : MAP.key Cobol_common__Srcloc.TYPES.with_loc -> t -> t
val define_compilation_var : loc:Cobol_common.Srcloc.srcloc -> var Cobol_common__Srcloc.TYPES.with_loc -> value Cobol_common.Srcloc.TYPES.with_src -> t -> t * compilation_var_definition
val find_compilation_var : MAP.key -> env -> compilation_var_definition option