language-sally-0.1.0.0: AST and pretty printer for Sally

CopyrightBenjamin F Jones 2016
LicenseISC
Maintainerbjones@galois.com
Stabilityexperimental
Portabilityunknown
Safe HaskellSafe
LanguageHaskell2010

Language.Sally.SExpPP

Contents

Description

This module gives a uniform way to pretty print S-expressions through a typeclass ToSExp.

Synopsis

S-expression pretty printing

data SExp Source #

A simple S-expression datatype with Doc values at the leaves.

Constructors

SXBare Doc

bare symbol or literal represented by a Doc

SXList [SExp]

list of SExp, e.g. (foo a b)

Instances

class ToSExp a where Source #

Typeclass for values that can be converted to a SExp. These values can then be pretty printed using the default layout scheme given by sxPretty.

Minimal complete definition

toSExp

Methods

toSExp :: a -> SExp Source #

sxPretty :: a -> Doc Source #

sxPrettyCompact :: a -> Doc Source #

Instances

ToSExp SExp Source #

Trivial ToSExp instance for SExp.

ToSExp SallySystem Source #

Pretty print a SallySystem.

ToSExp SallyTransition Source # 
ToSExp SallyStateFormula Source # 
ToSExp SallyState Source # 
ToSExp SallyArith Source # 
ToSExp SallyPred Source # 
ToSExp SallyExpr Source # 
ToSExp SallyVar Source # 
ToSExp SallyBaseType Source # 
ToSExp SallyConst Source # 
ToSExp Name Source # 

bareText :: Text -> SExp Source #

Inject a text literal as a SExp.

misc

sallyCom :: Doc Source #

A Sally comment.