| 1 |
(* |
| 2 |
* An ``intelligent'' pretty printer |
| 3 |
*) |
| 4 |
signature PP = |
| 5 |
sig |
| 6 |
|
| 7 |
type pp (* a piece of pretty printed text *) |
| 8 |
|
| 9 |
val ++ : pp * pp -> pp (* combine two pieces of text *) |
| 10 |
val ! : string -> pp (* an identifier *) |
| 11 |
val !! : string -> pp (* a symbol *) |
| 12 |
val int : int -> pp (* an integer *) |
| 13 |
val int32 : Int32.int -> pp (* an integer *) |
| 14 |
val intinf : IntInf.int -> pp (* an integer *) |
| 15 |
val char : char -> pp (* an ML character *) |
| 16 |
val word : word -> pp (* an ML word constant *) |
| 17 |
val word32 : Word32.word -> pp (* an ML word constant *) |
| 18 |
val real : real -> pp (* an ML real constant *) |
| 19 |
val string : string -> pp (* an ML string constant *) |
| 20 |
val bool : bool -> pp (* a boolean *) |
| 21 |
val nop : pp (* empty text *) |
| 22 |
val indent : pp (* add indentation *) |
| 23 |
val settab : pp (* set the current position as tab *) |
| 24 |
val unindent : pp (* remove indentation *) |
| 25 |
val tab : pp (* move to tab position *) |
| 26 |
val tab' : int -> pp |
| 27 |
val setmode : string -> pp |
| 28 |
val unsetmode : pp |
| 29 |
val select : (string -> pp) -> pp |
| 30 |
val sp : pp |
| 31 |
val nl : pp |
| 32 |
val nl' : int * int -> pp |
| 33 |
val block : pp -> pp |
| 34 |
val line : pp -> pp |
| 35 |
val seq : (pp * pp * pp) -> pp list -> pp |
| 36 |
val paren : pp -> pp |
| 37 |
val group : string * string -> pp -> pp |
| 38 |
val concat : pp list -> pp |
| 39 |
val text : pp -> string |
| 40 |
val textWidth : int -> pp |
| 41 |
|
| 42 |
end |