Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/smlnj-lib/PP/src/pp-device-sig.sml
ViewVC logotype

Annotation of /sml/trunk/src/smlnj-lib/PP/src/pp-device-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 651 - (view) (download)

1 : monnier 7 (* pp-device-sig.sml
2 :     *
3 :     * COPYRIGHT (c) 1997 Bell Labs, Lucent Technologies.
4 :     *
5 :     * A pretty-printer device is an abstraction of an output stream.
6 :     *)
7 :    
8 :     signature PP_DEVICE =
9 :     sig
10 :     type device
11 :     (* a device is an abstraction of an output stream. *)
12 :    
13 :     type style
14 :     (* an abstraction of font and color information. A device keeps a stack
15 :     * of styles, with the top of stack being the "current" style.
16 :     * Implementers of this signature should extend it with functions for
17 :     * creating style values.
18 :     *)
19 :    
20 :     val sameStyle : (style * style) -> bool
21 :     (* are two styles the same? *)
22 :    
23 :     val pushStyle : (device * style) -> unit
24 :     val popStyle : device -> unit
25 :     (* push/pop a style from the devices style stack. A pop on an
26 :     * empty style stack is a nop.
27 :     *)
28 :    
29 :     val defaultStyle : device -> style
30 :     (* the default style for the device (this is the current style,
31 :     * if the style stack is empty).
32 :     *)
33 :    
34 :     val depth : device -> int option
35 :     (* maximum printing depth (in terms of boxes) *)
36 :     val lineWidth : device -> int option
37 :     (* the width of the device *)
38 :     val textWidth : device -> int option
39 :     (* the suggested maximum width of text on a line *)
40 :    
41 :     val space : (device * int) -> unit
42 :     (* output some number of spaces to the device *)
43 :    
44 :     val newline : device -> unit
45 :     (* output a new-line to the device *)
46 :    
47 :     val string : (device * string) -> unit
48 :     val char : (device * char) -> unit
49 :     (* output a string/character in the current style to the device *)
50 :    
51 :     val flush : device -> unit
52 :     (* if the device is buffered, then flush any buffered output *)
53 :    
54 :     end;
55 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0