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/devices/textio-pp.sml
ViewVC logotype

Annotation of /sml/trunk/src/smlnj-lib/PP/devices/textio-pp.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 651 - (view) (download)

1 : monnier 467 (* textio-pp.sml
2 :     *
3 :     * COPYRIGHT (c) 1999 Bell Labs, Lucent Technologies.
4 :     *
5 :     * A pretty printer with TextIO output; there are no styles and
6 :     * tokens are atoms.
7 :     *)
8 :    
9 :     structure TextIOPP : sig
10 :    
11 :     include PP_STREAM
12 :    
13 :     val openOut : {dst : TextIO.outstream, wid : int} -> stream
14 :    
15 :     end = struct
16 :    
17 :     structure Tok : PP_TOKEN =
18 :     struct
19 :     type style = unit
20 :     type token = Atom.atom
21 :     val string = Atom.toString
22 :     fun style _ = ()
23 :     fun size s = String.size(Atom.toString s)
24 :     end
25 :    
26 :     structure PP = PPStreamFn (
27 :     structure Token = Tok
28 :     structure Device = SimpleTextIODev)
29 :    
30 :     open PP
31 :    
32 :     fun openOut arg = openStream(SimpleTextIODev.openDev arg)
33 :    
34 :     end;
35 :    

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