module Make
    (Parser : MenhirLib.IncrementalEngine.EVERYTHING)
    (Recovery : sig
      val default_value : Location.t -> 'a Parser.symbol -> 'a

      type action =
        | Abort
        | R of int
        | S : 'a Parser.symbol -> action
        | Sub of action list

      type decision =
        | Nothing
        | One of action list
        | Select of (int -> action list)

      val depth : int array

      val can_pop : 'a Parser.terminal -> bool

      val recover : int -> decision

      val guide : 'a Parser.symbol -> bool

      val token_of_terminal : 'a Parser.terminal -> 'a -> Parser.token

      val nullable : 'a Parser.nonterminal -> bool
    end)
    (Dump : sig
      val symbol : unit -> Parser.xsymbol -> string
    end) : sig
  type 'a candidate =
    { line : int; min_col : int; max_col : int; env : 'a Parser.env }

  type 'a candidates =
    { popped : Parser.xsymbol list;
      shifted : Parser.xsymbol option;
      final : 'a option;
      candidates : 'a candidate list
    }

  val attempt :
    'a candidates ->
    Parser.token * Lexing.position * Lexing.position ->
    [> `Accept of 'a | `Fail | `Ok of 'a Parser.checkpoint * 'a Parser.env ]

  val generate : 'a Parser.env -> 'a candidates
end
