Cobol_preprocmodule Src_format : sig ... end"Text" refers to the source after manipulations by preprocessor statements.
module Text : sig ... endmodule Text_printer : sig ... endmodule Src_overlay : sig ... endA source overlay associates complex source code elements with virtual limits of lexing tokens that can be fed to parsers so as to tag ASTs with complex source locations.
module Trace : sig ... endmodule Directives : sig ... endmodule Diagnostics : sig ... endmodule Outputs : sig ... endmodule Env : sig ... endEnvironment for preprocessing and compilation. Holds definitions of preprocessor constants (preprocessor DEFINES, computation process variables), along with compilation variables (78-level constants).
module Input : sig ... endmodule Options : sig ... endval preprocessor :
options:Cobol_preproc__.Preproc_options.preproc_options ->
Cobol_preproc__.Src_input.t ->
preprocessorval reset_preprocessor_for_string :
string ->
?new_position:Stdlib.Lexing.position ->
preprocessor ->
preprocessorval diags : preprocessor -> Cobol_preproc__.Preproc_diagnostics.diagnosticsval position : preprocessor -> Stdlib.Lexing.positionval position_at :
line:int ->
char:int ->
preprocessor ->
Stdlib.Lexing.positionval input_filename : preprocessor -> string optionval source_format : preprocessor -> Src_format.anyval rev_log : preprocessor -> Cobol_preproc__.Preproc_trace.TYPES.logval rev_comments : preprocessor -> Text.comments EzCompat.StringMap.trev_comments pp associates filenames read by pp (directly or indirectly while processing copybooks) with comments read in each respective file, in reverse order.
As a special rule the returned map always includes an association between "" and the file fed to pp.
val rev_ignored : preprocessor -> Cobol_common.Srcloc.TYPES.lexloc listrev_ignored pp lists the lexical locations ignored when reading the file given to pp.
val next_chunk : preprocessor -> Text.text * preprocessorval bind_78_constant :
preprocessor ->
loc:Cobol_common.Srcloc.TYPES.srcloc ->
Cobol_ptree.name Cobol_common.Srcloc.TYPES.with_loc ->
Cobol_ptree.literal Cobol_common.Srcloc.TYPES.with_loc ->
preprocessorBinds 78-level constants; managed by the preprocessor as MF allows use of such constants in compilation directives.
Given loc should correspond to the area in the source code where the definition occurs.
val lookup_compilation_variable :
preprocessor ->
Cobol_preproc__.Preproc_env.VAR.t ->
Cobol_preproc__.Preproc_env.TYPES.compilation_variable_definition
Cobol_common.Srcloc.TYPES.with_src
optionval record_compilation_variable_substitution :
preprocessor ->
loc:Cobol_common.Srcloc.TYPES.srcloc ->
var:Cobol_preproc__.Preproc_env.VAR.t ->
def:
Cobol_preproc__.Preproc_env.TYPES.compilation_variable_definition
Cobol_common.Srcloc.TYPES.with_src ->
preprocessorval lex_input :
platform:Cobol_common.Platform.TYPES.platform ->
dialect:Cobol_config.dialect ->
source_format:Cobol_config.source_format_spec ->
?ppf:Stdlib.Format.formatter ->
Cobol_preproc__.Src_input.t ->
unit Cobol_preproc__.Preproc_outputs.TYPES.with_diagsval lex_file :
platform:Cobol_common.Platform.TYPES.platform ->
dialect:Cobol_config.dialect ->
source_format:Cobol_config.source_format_spec ->
?ppf:Stdlib.Format.formatter ->
string ->
unit Cobol_preproc__.Preproc_outputs.TYPES.with_diagsval lex_lib :
platform:Cobol_common.Platform.TYPES.platform ->
dialect:Cobol_config.dialect ->
source_format:Cobol_config.source_format_spec ->
lookup_config:Cobol_common.Copybook.TYPES.lookup_config ->
?ppf:Stdlib.Format.formatter ->
Cobol_common.Copybook.TYPES.fileloc ->
unit Cobol_preproc__.Preproc_outputs.TYPES.with_diagsval fold_source_lines :
platform:Cobol_common.Platform.TYPES.platform ->
dialect:Cobol_config.dialect ->
source_format:Cobol_config.source_format_spec ->
?on_change_of_source_format:(Src_format.any -> 'a -> 'a) ->
?skip_compiler_directives_text:bool ->
?on_compiler_directive:
(int ->
Cobol_preproc__.Preproc_directives.compiler_directive
Cobol_common.Srcloc.TYPES.with_loc ->
'a ->
'a) ->
f:(int -> Text.text -> 'a -> 'a) ->
Cobol_preproc__.Src_input.t ->
'a ->
'afold_source_lines ~dialect ~source_format ~skip_compiler_directives_text ~on_compiler_directive ~on_initial_source_format ~f input acc applies f line_number line acc for each successive source line line of input. line_number gives the line number for line (starting at 1). line is given empty to f if it corresponds to an empty line in the input, or was a line continuation in the case of fixed-width reference format.
When given, on_compiler_directive is called after f has been fed with the text of a compiler directive, with the same line number.
When given, on_change_of_source_format is called each time the source format changes: once at the begining before f has been called, and then once each time a compiler directive that changes the source format is encountered (right after the text is fed to f but before on_compiler_directive is called).
When set, skip_compiler_directives_text (false by default) prevents the text of compiler directives from being fed to f. If given, on_compiler_directive is called as if the text had been fed to f.
Diagnostics resulting from lexing and parsing the input are attached to the returned accumulated value.
val scan_prefix_for_copybook :
platform:Cobol_common.Platform.TYPES.platform ->
dialect:Cobol_config.dialect ->
source_format:Cobol_config.source_format_spec ->
Cobol_preproc__.Src_input.t ->
[ `Program | `Copybook ]val text_of_file :
options:Cobol_preproc__.Preproc_options.preproc_options ->
string ->
Text.t Cobol_preproc__.Preproc_outputs.TYPES.with_diagsval text_of_input :
options:Cobol_preproc__.Preproc_options.preproc_options ->
Cobol_preproc__.Src_input.t ->
Text.t Cobol_preproc__.Preproc_outputs.TYPES.with_diags