Overview  Index  Help 
SMLFormat

FormatExpression


structure FormatExpression : FORMAT_EXPRESSION =
struct
  type assoc = {cut : bool, strength : int, direction : assocDirection}
  datatype priority = Preferred of int | Deferred
  datatype assocDirection = Left | Right | Neutral
  datatype expression =
           Term of int * string
         | Guard of assoc option * expression list
         | Indicator of {space : bool, newline : {priority : priorityoption}
         | StartOfIndent of int
         | EndOfIndent
  val isHigherThan : priority * priority -> bool
  val assocToString : assoc -> string
  val priorityToString : priority -> string
  val toString : expression -> string
  val parse
      : (char, 'a) StringCvt.reader -> (expression list, 'a) StringCvt.reader
end

This module defines types which represents format expressions.

Author:
YAMATODANI Kiyoshi
Version:
$Id: StrFormatExpression.html,v 1.5 2007/03/27 15:03:01 kiyoshiy Exp $

 
Type detail

assoc

type assoc = {cut : bool, strength : int, direction : assocDirection}

 
Datatype detail

priority

datatype priority = Preferred of int | Deferred


assocDirection

datatype assocDirection = Left | Right | Neutral


expression

datatype expression =
         Term of int * string
       | Guard of assoc option * expression list
       | Indicator of {space : bool, newline : {priority : priorityoption}
       | StartOfIndent of int
       | EndOfIndent

 
DataConstructor detail

Preferred

constructor Preferred : int -> priority


Deferred

constructor Deferred : priority


Left

constructor Left : assocDirection


Right

constructor Right : assocDirection


Neutral

constructor Neutral : assocDirection


Term

constructor Term : int * string -> expression


Guard

constructor Guard : assoc option * expression list -> expression


Indicator

constructor Indicator
            : {space : bool, newline : {priority : priorityoption} ->
                expression


StartOfIndent

constructor StartOfIndent : int -> expression


EndOfIndent

constructor EndOfIndent : expression

 
Value detail

isHigherThan

val isHigherThan : priority * priority -> bool


assocToString

val assocToString : assoc -> string


priorityToString

val priorityToString : priority -> string


toString

val toString : expression -> string


parse

val parse
    : (char, 'a) StringCvt.reader -> (expression list, 'a) StringCvt.reader

 


Overview  Index  Help 
SMLFormat: Pretty-Printer library for SML