Cobol_parsermodule Options : sig ... endOptions to tune the parser engine
module Outputs : sig ... endOutput types for the engine
module Diagnostics : sig ... endmodule Tokens : sig ... endmodule Expect : sig ... endmodule Printer : sig ... endmodule Keywords : sig ... endmodule Grammar_interpr : sig ... endtype 'm simple_parsing =
options:Cobol_parser__.Parser_options.parser_options ->
Cobol_preproc.preprocessor ->
(Cobol_ptree.compilation_group option, 'm)
Cobol_parser__.Parser_outputs.output
Cobol_common__Diagnostics_accumulator.MAKE(Cobol_parser__.Parser_diagnostics.ALL).TYPES.with_diagsSimple parsing functions traverse the inputs once to produce a result.
val parse_simple : Cobol_common.Behaviors.amnesic simple_parsingSimple parsing function that does not return any artifact.
val parse_with_artifacts : Cobol_common.Behaviors.eidetic simple_parsingSimple parsing function does return some artifacts.
type 'm rewindable_parsing =
options:Cobol_parser__.Parser_options.parser_options ->
Cobol_preproc.preprocessor ->
(((Cobol_ptree.compilation_group option, 'm)
Cobol_parser__.Parser_outputs.output as 'x)
* 'x rewinder)
Cobol_common__Diagnostics_accumulator.MAKE(Cobol_parser__.Parser_diagnostics.ALL).TYPES.with_diagsRewindable parsing functions extend the behaviors of simple parsing functions, with the ability to rewind the parser (and pre-processor) before a given lexing position. To this end, their results include a rewinder that may then be given to rewind_and_parse.
and preprocessor_rewind =
last_pp:(Cobol_preproc.preprocessor as 'r) ->
?new_position:Stdlib.Lexing.position ->
'r ->
'rFunctions for rewinding the pre-processor. Such a function should return a preprocessor in the exact same state as the one given in (unlabelled) argument, with the only exception that the input text is now read from new_position.
last_pp is the state of the pre-processor at the end of the previous call to rewindable_parse_simple, rewindable_parse_with_artifacts, or rewind_and_parse operation: it may be used to translate positions that follow the last piece of input seen by the unlabelled preprocessor argument.
If new_position is not given, the text should be read from the very beginning of the input.
val rewindable_parse_simple : Cobol_common.Behaviors.amnesic rewindable_parsingRewindable parsing function that does not return any artifact.
val rewindable_parse_with_artifacts :
Cobol_common.Behaviors.eidetic rewindable_parsingRewindable parsing function that does return some artifacts.
val rewind_and_parse :
'x rewinder ->
preprocessor_rewind ->
position:position ->
(((Cobol_ptree.compilation_group option, 'm)
Cobol_parser__.Parser_outputs.output as 'x)
* 'x rewinder)
Cobol_common__Diagnostics_accumulator.MAKE(Cobol_parser__.Parser_diagnostics.ALL).TYPES.with_diagsrewind_and_parse rewinder preprocessor_rewind ~position uses rewinder to restart parsing before the given position. Note that the new_position argument that is given to preprocessor_rewind may not correspond to position, as the parser typically needs to rewind earlier than position.
type inspectable_parser_state = | Env : 'a Cobol_parser__.Grammar.MenhirInterpreter.env -> inspectable_parser_state| SinkType of parser states that can be inspected using the interpreter that is generated by menhir (cf INSPECT).
val rewind_for_inspection :
'x rewinder ->
preprocessor_rewind ->
position:position ->
inspect:(inspectable_parser_state -> 'a) ->
'aNote: given parser state should not escapre inspect.
val artifacts :
(_, Cobol_common.Behaviors.eidetic) Cobol_parser__.Parser_outputs.output ->
Cobol_parser__.Parser_outputs.artifactsSignatures of modules below may change unexpectedly.
module INTERNAL : sig ... end