language-objc- Analysis and generation of Objective C code

Safe HaskellNone




This module provides a pretty printer for the parse tree (AST).


Pretty Printing

class Pretty p whereSource

A class of types which can be pretty printed


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


Pretty CUnaryOp 
Pretty CBinaryOp 
Pretty CAssignOp 
Pretty Ident 
Pretty SUERef 
Pretty CStrLit 
Pretty CConst 
Pretty ObjCConst 
Pretty CBuiltin 
Pretty ObjCKeyArg 
Pretty ObjCMsgSel 
Pretty ObjCMsgExpr 
Pretty ObjCSel 
Pretty ObjCSelKeyName 
Pretty ObjCSelName 
Pretty CExpr 
Pretty CAttr 
Pretty CDesignator 
Pretty CInit 
Pretty CEnum 
Pretty CStructTag 
Pretty CStructUnion 
Pretty ObjCProtoQual 
Pretty CTypeQual 
Pretty CTypeSpec 
Pretty CStorageSpec 
Pretty CDeclSpec 
Pretty CBlockItem 
Pretty CAsmOperand 
Pretty CAsmStmt 
Pretty CStat 
Pretty CArrSize 
Pretty CDeclr 
Pretty CDecl 
Pretty ObjCPropMod 
Pretty ObjCPropDecl 
Pretty ObjCKeyDeclr 
Pretty ObjCMethodSel 
Pretty ObjCMethodType 
Pretty ObjCMethodDef 
Pretty ObjCMethodDecl 
Pretty ObjCImplDef 
Pretty ObjCIfaceDecl 
Pretty ObjCVisType 
Pretty ObjCVisSpec 
Pretty ObjCInstanceVarBlock 
Pretty ObjCProtoNm 
Pretty ObjCClassNm 
Pretty ObjCClassDeclr 
Pretty ObjCImpl 
Pretty ObjCIface 
Pretty ObjCProtoDeclBlock 
Pretty ObjCProtoDec 
Pretty ObjCClassDef 
Pretty ObjCCatImpl 
Pretty ObjCCatDec 
Pretty CFunDef 
Pretty CExtDecl 
Pretty CTranslUnit 
Pretty Attributes 
Pretty Attr 
Pretty VarName 
Pretty TypeQuals 
Pretty Enumerator 
Pretty EnumType 
Pretty CompTyKind 
Pretty CompType 
Pretty EnumTypeRef 
Pretty CompTypeRef 
Pretty Type 
Pretty Linkage 
Pretty Storage 
Pretty DeclAttrs 
Pretty VarDecl 
Pretty TypeDef 
Pretty MemberDecl 
Pretty ParamDecl 
Pretty FunDef 
Pretty ObjDef 
Pretty Decl 
Pretty GlobalDecls 
Pretty IdentDecl 
Pretty TagDef 
Pretty DefTable 
Pretty TagFwdDecl 
(Pretty a, Pretty b) => Pretty (Either a b) 


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 useful for testing, as otherwise the pretty printed file will be cluttered with declarations from system headers.