|
Sdf2Pretty | Portability | portable | Stability | experimental | Maintainer | Joost Visser |
|
|
|
|
|
Description |
This module is part of Sdf2Haskell, a tool for generating Haskell
code from an SDF grammar. This module contains functions generating
pretty-print support. |
|
Synopsis |
|
|
|
|
Starting point |
|
generatePrettyModule :: String -> String -> SDF -> HsModule |
Generate a Haskell model with functions for pretty-printing support |
|
Generation of imports |
|
prettyImports :: String -> [HsImportDecl] |
Generate the import list |
|
Generation of function definitions |
|
genPrettyDecls :: String -> SDF -> [HsDecl] |
Generate both instance declarations and the generic pretty-printing
function. |
|
genPrettyFun :: String -> SDF -> [HsDecl] |
Generate the generic pretty-printing function. |
|
genInstDecls :: SDF -> [HsDecl] |
Generate the instance declarations. |
|
production2instdecl :: Production -> Maybe HsDecl |
Generate an instance declaration from an Sdf production |
|
symbols2pvars :: [Symbol] -> [HsPat] |
Convert Sdf symbols into Haskell pattern variables. |
|
symbols2docs :: [Symbol] -> [HsExp] |
Convert Sdf symbols into Doc expressions. |
|
symbol2doc :: (String, Symbol) -> HsExp |
Convert an Sdf symbol into a Doc expression. |
|
Produced by Haddock version 0.6 |