Module Src_overlay.New_manager

Nanager module instantiation

Parameters

module Id : sig ... end

Signature

val id : string

Identifier of the manager; may be used for debugging.

limits loc creates and returns the left- and right-limit to the given location.

Note: if loc overlaps with locations that have already been fed to this function, then restart must first be called.

link_limits left right links the right limit of a token t to the left limit of the subsequent token t' (that is to be fed to the parser right after t).

val join_limits : (limit * limit) -> Cobol_common.Srcloc.srcloc

join_limits (start_limit, end_limit) returns a source location that spans from start_limit to end_limit. start_limit must have been built (via limits) before end_limit.

val restart : ?at:limit -> unit -> unit

restart ?at () instructs the manager that the limits that are strictly at the right of at are now outdated and should not be relied upon. When given at should be a right limit. If at is not given, every managed limit is discarded.

Warning: when at = None, the manager resets all its internal tables. This may cause trouble in case it is shared among several independent parsers for various input files.

val with_temporary_copy : f:('a -> 'b) -> 'a -> 'b

with_temporary_copy ~f a saves the internal state s of the manager, evaluates f a, and then restores s.