Printers.mli 2.63 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

14 15
(* This module is part of MenhirLib. *)

16
module Make
17

18
  (I : IncrementalEngine.EVERYTHING)
19

20
  (User : sig
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

    (* [print s] is supposed to send the string [s] to some output channel. *)

    val print: string -> unit

    (* [print_symbol s] is supposed to print a representation of the symbol [s]. *)

    val print_symbol: I.xsymbol -> unit

    (* [print_element e] is supposed to print a representation of the element [e].
       This function is optional; if it is not provided, [print_element_as_symbol]
       (defined below) is used instead. *)

    val print_element: (I.element -> unit) option

36
  end)
37

38 39
: sig

40 41
  open I

42 43
  (* Printing a list of symbols. *)

44
  val print_symbols: xsymbol list -> unit
45

46 47 48
  (* Printing an element as a symbol. This prints just the symbol
     that this element represents; nothing more. *)

49
  val print_element_as_symbol: element -> unit
50

51 52
  (* Printing a stack as a list of elements. This function needs an element
     printer. It uses [print_element] if provided by the user; otherwise
53
     it uses [print_element_as_symbol]. (Ending with a newline.) *)
54

55
  val print_stack: 'a env -> unit
56

57
  (* Printing an item. (Ending with a newline.) *)
58

59
  val print_item: item -> unit
60

61
  (* Printing a production. (Ending with a newline.) *)
62

63
  val print_production: production -> unit
64

65 66 67 68
  (* Printing the current LR(1) state. The current state is first displayed
     as a number; then the list of its LR(0) items is printed. (Ending with
     a newline.) *)

69
  val print_current_state: 'a env -> unit
70 71 72

  (* Printing a summary of the stack and current state. This function just
     calls [print_stack] and [print_current_state] in succession. *)
73

74
  val print_env: 'a env -> unit
75

76
end