Safe Haskell | None |
---|---|
Language | Haskell98 |
A Pretty printer for CPSScheme
-files and control flow.
- ppProg :: Bool -> Prog -> Doc
- renderProg :: Bool -> Prog -> String
- ppLambda :: Bool -> Lambda -> Doc
- ppCall :: Bool -> Call -> Doc
- ppVal :: Bool -> Val -> Doc
- startAt :: Integer
- labelToChar :: Label -> Char
- charToLabel :: Char -> Maybe Label
- embeddLabel :: Bool -> Label -> Doc
- labelPositions :: Char -> String -> (Label :⇀ (Integer, Integer), String)
- removeLambdas :: String -> String
- ipProg :: Prog -> Doc
- renderProgToIsa :: Prog -> String
- ipLambda :: Lambda -> Doc
- ipVar :: Var -> Doc
- ipCall :: Call -> Doc
- ipVal :: Val -> Doc
- ipPrim :: Prim -> Doc
Pretty printer for CPSScheme
programs, omitting any labels
ppProg :: Bool -> Prog -> Doc Source
Pretty-Prints a whole document. The first flag, if set to true, embedds the label information by abusing high range unicode characters.
renderProg :: Bool -> Prog -> String Source
Renders to a String
Label embedding trick
labelToChar :: Label -> Char Source
charToLabel :: Char -> Maybe Label Source
embeddLabel :: Bool -> Label -> Doc Source
labelPositions :: Char -> String -> (Label :⇀ (Integer, Integer), String) Source
Given a replacement function and a string containing embedded labels, this function replaces the labels by the given replacement character and calculates a map of labels to positions in the text (1-based row and column indexing)
removeLambdas :: String -> String Source
HPDF can not print lambdas. Therefore, replace them by backslashes.
Printing to Isablle-Expression
Converts the whole program into an expression that can be copyn
pasted
into an Isabelle source file
renderProgToIsa :: Prog -> String Source
Renders to a String