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 /smlnj-lib/branches/rt-transition/PP/src/pp-stream-sig.sml
ViewVC logotype

Annotation of /smlnj-lib/branches/rt-transition/PP/src/pp-stream-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 411 - (view) (download)
Original Path: sml/branches/SMLNJ/src/smlnj-lib/PP/src/pp-stream-sig.sml

1 : monnier 7 (* pp-stream-sig.sml
2 :     *
3 :     * COPYRIGHT (c) 1997 Bell Labs, Lucent Technologies.
4 :     *
5 :     * This interface provides a output stream interface to pretty printing.
6 :     *)
7 :    
8 :     signature PP_STREAM =
9 :     sig
10 :     type device
11 :     type stream
12 :    
13 :     type token
14 :     (* tokens are an abstraction of strings (allowing for different
15 :     * widths and style information).
16 :     *)
17 :     type style
18 :    
19 :     datatype indent
20 :     = Abs of int (* indent relative to outer indentation *)
21 :     | Rel of int (* indent relative to start of box *)
22 :    
23 :     val openStream : device -> stream
24 :     val flushStream : stream -> unit
25 :     val closeStream : stream -> unit
26 :    
27 :     val openHBox : stream -> unit
28 :     val openVBox : stream -> indent -> unit
29 :     val openHVBox : stream -> indent -> unit
30 :     val openHOVBox : stream -> indent -> unit
31 :     val openBox : stream -> indent -> unit
32 :     val closeBox : stream -> unit
33 :    
34 :     val token : stream -> token -> unit
35 :     val string : stream -> string -> unit
36 :    
37 :     val pushStyle : (stream * style) -> unit
38 :     val popStyle : stream -> unit
39 :    
40 :     val break : stream -> {nsp : int, offset : int} -> unit
41 :     val space : stream -> int -> unit
42 :     (* space n == break{nsp=n, offset=0} *)
43 :     val cut : stream -> unit
44 :     (* cut == break{nsp=0, offset=0} *)
45 :     val newline : stream -> unit
46 :     val nbSpace : stream -> int -> unit
47 :     (* emits a nonbreakable space *)
48 :    
49 :     val onNewline : stream -> unit -> unit
50 :     (* the command is executed iff it is preceeded by a newline *)
51 :    
52 : monnier 289 val control : stream -> (device -> unit) -> unit
53 :    
54 : monnier 411 (* pretty-print a PP description *)
55 :     type pp_desc
56 :     val description : stream -> pp_desc -> unit
57 :    
58 :     (* PP description constructors *)
59 :     structure Desc : sig
60 :     val hBox : pp_desc list -> pp_desc
61 :     val vBox : (indent * pp_desc list) -> pp_desc
62 :     val hvBox : (indent * pp_desc list) -> pp_desc
63 :     val hovBox : (indent * pp_desc list) -> pp_desc
64 :     val box : (indent * pp_desc list) -> pp_desc
65 :     val token : token -> pp_desc
66 :     val string : string -> pp_desc
67 :     val style : (style * pp_desc list) -> pp_desc
68 :     val break : {nsp : int, offset : int} -> pp_desc
69 :     val space : int -> pp_desc
70 :     val cut : pp_desc
71 :     val newline : pp_desc
72 :     val control : (device -> unit) -> pp_desc
73 :     end
74 :    
75 : monnier 7 end
76 :    

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