Printers.mli 1.67 KB
Newer Older
1 2
(* This module is part of MenhirLib. *)

3
module Make
4

5
  (I : IncrementalEngine.EVERYTHING)
6

7
  (User : sig
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

    (* [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

23
  end)
24

25 26
: sig

27 28
  open I

29 30
  (* Printing a list of symbols. *)

31
  val print_symbols: xsymbol list -> unit
32

33 34 35
  (* Printing an element as a symbol. This prints just the symbol
     that this element represents; nothing more. *)

36
  val print_element_as_symbol: element -> unit
37

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

42
  val print_stack: stack -> unit
43

44
  (* Printing an item. (Ending with a newline.) *)
45

46
  val print_item: item -> unit
47

48
  (* Printing a production. (Ending with a newline.) *)
49

50
  val print_production: production -> unit
51

52 53 54 55
  (* 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.) *)

56 57 58 59
  val print_current_state: env -> unit

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

61
  val print_env: env -> unit
62

63 64
end