language-c-0.3.2: Analysis and generation of C codeSource codeContentsIndex
Language.C.Pretty
Portabilityportable
Stabilityexperimental
Maintainerbenedikt.huber@gmail.com
Contents
Pretty Printing
Testing
Description
This module provides a pretty printer for the parse tree (Language.C.Syntax.AST).
Synopsis
class Pretty p where
pretty :: p -> Doc
prettyPrec :: Int -> p -> Doc
prettyUsingInclude :: CTranslUnit -> Doc
Pretty Printing
class Pretty p whereSource
A class of types which can be pretty printed
Methods
pretty :: p -> DocSource
pretty print the given value
prettyPrec :: Int -> p -> DocSource
prettyPrec prec p pretty prints p assuming that the surrounding context has a precedence of prec
show/hide Instances
Testing
prettyUsingInclude :: CTranslUnit -> DocSource

Pretty print the given tranlation unit, but replace declarations from header files with #include directives.

The resulting file may not compile (because of missing #define directives and similar things), but is very usefull for testing, as otherwise the pretty printed file will be cluttered with declarations from system headers.

Produced by Haddock version 2.4.2