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

SCM Repository

[smlnj] View of /smlnj-lib/branches/rt-transition/PP/src/pp-stream-sig.sml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2980 - (download) (annotate)
Sat Apr 12 15:01:15 2008 UTC (11 years, 2 months ago) by jhr
File size: 1494 byte(s)
  Create branch of SML/NJ Library to work around missing APIs.
(* pp-stream-sig.sml
 *
 * COPYRIGHT (c) 2005 John Reppy (http://www.cs.uchicago.edu/~jhr)
 * All rights reserved.
 *
 * This interface provides a output stream interface to pretty printing.
 *)

signature PP_STREAM =
  sig
    type device
    type stream

    type token
	(* tokens are an abstraction of strings (allowing for different
	 * widths and style information).
	 *)
    type style

    datatype indent
      = Abs of int		(* indent relative to outer indentation *)
      | Rel of int		(* indent relative to start of box *)

    val openStream  : device -> stream
    val flushStream : stream -> unit
    val closeStream : stream -> unit
    val getDevice   : stream -> device

    val openHBox   : stream -> unit
    val openVBox   : stream -> indent -> unit
    val openHVBox  : stream -> indent -> unit
    val openHOVBox : stream -> indent -> unit
    val openBox    : stream -> indent -> unit
    val closeBox   : stream -> unit

    val token   : stream -> token -> unit
    val string  : stream -> string -> unit

    val pushStyle : (stream * style) -> unit
    val popStyle  : stream -> unit

    val break   : stream -> {nsp : int, offset : int} -> unit
    val space   : stream -> int -> unit
	(* space n == break{nsp=n, offset=0} *)
    val cut     : stream -> unit
	(* cut == break{nsp=0, offset=0} *)
    val newline : stream -> unit
    val nbSpace : stream -> int -> unit
	(* emits a nonbreakable space *)

    val control : stream -> (device -> unit) -> unit

  end


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