Class

at.logic.gapt.formats.babel

BabelExporter

Related Doc: package babel

Permalink

class BabelExporter extends PrettyPrinter

Exports lambda expressions in the Babel format. You probably do not want to use this class, use one of expression.toString, .toSigRelativeString, or .toAsciiString instead. These are all implemented using this class.

This exporter is implemented using the pretty-printing library included in Kiama.

Source
export.scala
Linear Supertypes
PrettyPrinter, PrettyPrinterBase, AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BabelExporter
  2. PrettyPrinter
  3. PrettyPrinterBase
  4. AnyRef
  5. Any
Implicitly
  1. by anyToPrettyPrintable
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BabelExporter(unicode: Boolean, sig: BabelSignature)

    Permalink

    unicode

    Whether to output logical connectives using Unicode symbols.

    sig

    The Babel signature, to decide whether we need to escape constants because they do not fit the naming convention.

Type Members

  1. class Doc extends ((org.kiama.output.PrettyPrinter.Indent, org.kiama.output.PrettyPrinter.Width)) ⇒ ((Int, Queue[(Int, (Boolean) ⇒ ((Int) ⇒ Trampoline[Seq[String]]) ⇒ Trampoline[(Int) ⇒ Trampoline[Seq[String]]])]) ⇒ Trampoline[(Int) ⇒ Trampoline[Seq[String]]]) ⇒ Trampoline[(Int, Queue[(Int, (Boolean) ⇒ ((Int) ⇒ Trampoline[Seq[String]]) ⇒ Trampoline[(Int) ⇒ Trampoline[Seq[String]]])]) ⇒ Trampoline[(Int) ⇒ Trampoline[Seq[String]]]] with org.kiama.output.PrettyPrinter.DocOps

    Permalink
    Definition Classes
    PrettyPrinter
  2. trait DocOps extends AnyRef

    Permalink
    Definition Classes
    PrettyPrinterBase
  3. type Indent = Int

    Permalink
    Definition Classes
    PrettyPrinterBase
  4. type Layout = String

    Permalink
    Definition Classes
    PrettyPrinterBase
  5. trait PrettyPrintable extends AnyRef

    Permalink
    Definition Classes
    PrettyPrinterBase
  6. type Width = Int

    Permalink
    Definition Classes
    PrettyPrinterBase

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from BabelExporter to any2stringadd[BabelExporter] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (BabelExporter, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from BabelExporter to ArrowAssoc[BabelExporter] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def align(d: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  7. def ampersand: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  8. def angles(d: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  9. def any(a: Any): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  10. implicit def anyToPrettyPrintable(a: Any): PrettyPrintable

    Permalink
    Definition Classes
    PrettyPrinterBase
  11. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  12. val asciiUnquotName: Regex

    Permalink
  13. def asterisk: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  14. def atsign: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  15. def backquote: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  16. def backslash: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  17. def braces(d: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  18. def brackets(d: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  19. def caret: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  20. def cat(ds: Seq[Doc]): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  21. implicit def char(c: Char): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  22. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. def colon: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  24. def column(f: (Int) ⇒ Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  25. def comma: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  26. val defaultIndent: Int

    Permalink
    Definition Classes
    BabelExporter → PrettyPrinterBase
  27. val defaultWidth: Int

    Permalink
    Definition Classes
    PrettyPrinterBase
  28. def dollar: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  29. def dot: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  30. def dquote: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  31. def dquotes(d: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  32. def empty: Doc

    Permalink
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  33. def enclose(l: Doc, d: Doc, r: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  34. def ensuring(cond: (BabelExporter) ⇒ Boolean, msg: ⇒ Any): BabelExporter

    Permalink
    Implicit information
    This member is added by an implicit conversion from BabelExporter to Ensuring[BabelExporter] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  35. def ensuring(cond: (BabelExporter) ⇒ Boolean): BabelExporter

    Permalink
    Implicit information
    This member is added by an implicit conversion from BabelExporter to Ensuring[BabelExporter] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  36. def ensuring(cond: Boolean, msg: ⇒ Any): BabelExporter

    Permalink
    Implicit information
    This member is added by an implicit conversion from BabelExporter to Ensuring[BabelExporter] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  37. def ensuring(cond: Boolean): BabelExporter

    Permalink
    Implicit information
    This member is added by an implicit conversion from BabelExporter to Ensuring[BabelExporter] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  38. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  39. def equal: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  40. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  41. def exclamation: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  42. def export(expr: LambdaExpression): String

    Permalink
  43. def fillcat(ds: Seq[Doc]): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  44. def fillsep(ds: Seq[Doc], sep: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  45. def fillsep(ds: Seq[Doc]): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  46. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  47. def folddoc(ds: Seq[Doc], f: (Doc, Doc) ⇒ Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  48. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from BabelExporter to StringFormat[BabelExporter] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  49. def forwslash: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  50. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  51. def group(d: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  52. def hang(d: Doc, i: Indent): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  53. def hash: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  54. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  55. def hcat(ds: Seq[Doc]): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  56. def hsep(ds: Seq[Doc], sep: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  57. def hsep(ds: Seq[Doc]): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  58. def indent(d: Doc, i: Indent): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  59. val infixRel: Set[String]

    Permalink
  60. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  61. def langle: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  62. def lbrace: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  63. def lbracket: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  64. def line: Doc

    Permalink
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  65. def line(repl: Layout): Doc

    Permalink
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  66. def linebreak: Doc

    Permalink
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  67. def list[T](l: Seq[T], prefix: String, elemToDoc: (T) ⇒ Doc, sep: Doc, sepfn: (Seq[Doc], Doc) ⇒ Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  68. val logicalConstName: Set[String]

    Permalink
  69. def lparen: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  70. def lsep(ds: Seq[Doc], sep: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  71. def lsep2(ds: Seq[Doc], sep: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  72. def lterm(ds: Seq[Doc], term: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  73. def minus: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  74. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  75. def nest(doc: Doc, j: Indent = defaultIndent): Doc

    Permalink
    Definition Classes
    BabelExporter → PrettyPrinter → PrettyPrinterBase
  76. def nesting(f: (Int) ⇒ Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  77. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  78. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  79. def padto(p: Int, d: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  80. def padtobreak(p: Int, d: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  81. def parenIf(enclosingPrio: Int, currentPrio: Int, doc: Doc): Doc

    Permalink
  82. def parens(d: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  83. def percent: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  84. def plist(l: List[PrettyPrintable], prefix: String, elemToDoc: (PrettyPrintable) ⇒ Doc, sep: Doc, sepfn: (Seq[Doc], Doc) ⇒ Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  85. def plus: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  86. def pretty(d: Doc, w: Width): Layout

    Permalink
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  87. def pretty(p: PrettyPrintable): Layout

    Permalink
    Definition Classes
    PrettyPrinterBase
  88. def pretty_any(a: Any): Layout

    Permalink
    Definition Classes
    PrettyPrinterBase
  89. object prio

    Permalink
  90. def pseq(l: Seq[PrettyPrintable], prefix: String, elemToDoc: (PrettyPrintable) ⇒ Doc, sep: Doc, sepfn: (Seq[Doc], Doc) ⇒ Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  91. def question: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  92. def rangle: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  93. def rbrace: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  94. def rbracket: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  95. def rparen: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  96. val safeChars: Regex

    Permalink
  97. def semi: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  98. def sep(ds: Seq[Doc]): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  99. def seq[T](l: Seq[T], prefix: String, elemToDoc: (T) ⇒ Doc, sep: Doc, sepfn: (Seq[Doc], Doc) ⇒ Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  100. def show(ty: Ty, needParens: Boolean): Doc

    Permalink
  101. def show(expr: LambdaExpression, knownType: Boolean, bound: Set[String], t0: Map[String, LambdaExpression], p: Int): (Doc, Map[String, LambdaExpression])

    Permalink

    Converts a lambda expression into a document.

    Converts a lambda expression into a document.

    At every point in the conversion, we keep track of:

    1. Whether the parser will already know the type of this expression (by inference)
    2. What type the free identifiers have.
    3. What priority the enclosing operator has.
    expr

    The lambda expression to convert.

    knownType

    Whether we already know the type of this expression.

    bound

    Names bound by enclosing binders.

    t0

    Already used free identifiers, together with the variable or constant they represent.

    p

    The priority of the enclosing operator.

    returns

    Pretty-printed document and the free identifiers.

  102. def showApps(expr: LambdaExpression, knownType: Boolean, bound: Set[String], t0: Map[String, LambdaExpression], p: Int): (Doc, Map[String, LambdaExpression])

    Permalink
  103. def showBin(sym: String, prio: Int, leftPrioBias: Int, rightPrioBias: Int, a: LambdaExpression, b: LambdaExpression, knownType: Boolean, bound: Set[String], t0: Map[String, LambdaExpression], p: Int): (Doc, Map[String, LambdaExpression])

    Permalink
  104. def showBinOp(c: Const, prio: Int, leftPrioBias: Int, rightPrioBias: Int, a: LambdaExpression, b: LambdaExpression, knownType: Boolean, bound: Set[String], t0: Map[String, LambdaExpression], p: Int): (Doc, Map[String, LambdaExpression])

    Permalink
  105. def showName(name: String): Doc

    Permalink
  106. def showQuant(sym: String, v: Var, e: LambdaExpression, bound: Set[String], t0: Map[String, LambdaExpression], p: Int): (Doc, Map[String, LambdaExpression])

    Permalink
  107. def softbreak: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  108. def softline: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  109. def space: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  110. def spaces(n: Int): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  111. def squote: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  112. def squotes(d: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  113. def ssep(ds: Seq[Doc], sep: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  114. def sterm(ds: Seq[Doc], term: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  115. def string(s: String): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  116. def surround(d: Doc, b: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  117. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  118. implicit def text(t: String): Doc

    Permalink
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  119. def tilde: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  120. def toDoc: org.kiama.output.PrettyPrinter.Doc

    Permalink
    Implicit information
    This member is added by an implicit conversion from BabelExporter to org.kiama.output.PrettyPrinter.PrettyPrintable performed by method anyToPrettyPrintable in org.kiama.output.PrettyPrinterBase.
    Definition Classes
    PrettyPrintable
  121. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  122. def underscore: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  123. def value(v: Any): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  124. def vcat(ds: Seq[Doc]): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  125. def verticalbar: Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  126. def vsep(ds: Seq[Doc], sep: Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  127. def vsep(ds: Seq[Doc]): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  128. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  129. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  130. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  131. def width(d: Doc, f: (Int) ⇒ Doc): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
  132. def [B](y: B): (BabelExporter, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from BabelExporter to ArrowAssoc[BabelExporter] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Deprecated Value Members

  1. def product(p: Any): Doc

    Permalink
    Definition Classes
    PrettyPrinterBase
    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.1) Use PrettyPrinter.any instead.

Inherited from PrettyPrinter

Inherited from PrettyPrinterBase

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion anyToPrettyPrintable from BabelExporter to org.kiama.output.PrettyPrinter.PrettyPrintable

Inherited by implicit conversion any2stringadd from BabelExporter to any2stringadd[BabelExporter]

Inherited by implicit conversion StringFormat from BabelExporter to StringFormat[BabelExporter]

Inherited by implicit conversion Ensuring from BabelExporter to Ensuring[BabelExporter]

Inherited by implicit conversion ArrowAssoc from BabelExporter to ArrowAssoc[BabelExporter]

Ungrouped