module Language.ObjC.Syntax.AST (
CTranslUnit, CExtDecl,
CTranslationUnit(..), CExternalDeclaration(..),
CFunDef, CDecl, CStructUnion, CEnum,
CFunctionDef(..), CDeclaration(..),
CStructTag(..), CStructureUnion(..), CEnumeration(..),
ObjCIface, ObjCClassDef, ObjCProtoNm, ObjCInstanceVarBlock, ObjCVisSpec,
ObjCPropDecl, ObjCSel, ObjCMethodSel, ObjCMethodDecl, ObjCProtoDec,
ObjCProtoDeclBlock, ObjCCatDec, ObjCImpl, ObjCCatImpl, ObjCMethodDef,
ObjCImplDef,
ObjCInterface(..), ObjCClassListDef(..), ObjCProtocolName(..),
ObjCInstanceVariableBlock(..),ObjCVisibilitySpec(..),ObjCVisType(..),
ObjCPropertyDeclaration(..), ObjCSelector(..), ObjCMethodSelector(..),
ObjCMethodType(..), ObjCMethodDeclaration(..), ObjCProtocolDec(..),
ObjCProtocolDeclBlock(..), ObjCCategoryDec(..), ObjCImplementation(..),
ObjCCategoryImplementation(..), ObjCMethodDefinition(..),
ObjCImplementationDefinition(..),
CDeclSpec, partitionDeclSpecs,
CStorageSpec, CTypeSpec, isSUEDef, CTypeQual, CAttr,
CDeclarationSpecifier(..), CStorageSpecifier(..), CTypeSpecifier(..),
CTypeQualifier(..), CAttribute(..),
ObjCPropMod, ObjCProtoQual,
ObjCPropertyModifier(..), ObjCProtoQualifier(..),
CDeclr,CDerivedDeclr,CArrSize,
CDeclarator(..), CDerivedDeclarator(..), CArraySize(..),
ObjCClassNm, ObjCClassDeclr, ObjCIfaceDecl, ObjCKeyDeclr,
ObjCClassName(..), ObjCClassDeclarator(..), ObjCInterfaceDeclaration(..),
ObjCKeywordDeclarator(..),
CInit, CInitList, CDesignator,
CInitializer(..), CInitializerList, CPartDesignator(..),
CStat, CBlockItem, CAsmStmt, CAsmOperand,
CStatement(..), CCompoundBlockItem(..),
CAssemblyStatement(..), CAssemblyOperand(..),
CExpr, CExpression(..),
CAssignOp(..), CBinaryOp(..), CUnaryOp(..),
CBuiltin, CBuiltinThing(..),
ObjCMsgExpr, ObjCMsgSel, ObjCKeyArg, ObjCSelName, ObjCSelKeyName,
ObjCMessageExpression(..), ObjCMessageSelector(..), ObjCKeywordArg(..),
ObjCSelectorName(..), ObjCSelectorKeyName(..),
CConst, CStrLit, cstringOfLit, liftStrLit,
CConstant(..), CStringLiteral(..),
ObjCConst,
ObjCConstant(..)
) where
import Language.ObjC.Syntax.Constants
import Language.ObjC.Syntax.Ops
import Language.ObjC.Data.Ident
import Language.ObjC.Data.Node
import Language.ObjC.Data.Position
import Data.Generics
type CTranslUnit = CTranslationUnit NodeInfo
data CTranslationUnit a
= CTranslUnit [CExternalDeclaration a] a
deriving (Show, Data, Typeable )
type CExtDecl = CExternalDeclaration NodeInfo
data CExternalDeclaration a
= CDeclExt (CDeclaration a)
| CFDefExt (CFunctionDef a)
| ObjCIfaceExt (ObjCInterface a)
| ObjCImplExt (ObjCImplementation a)
| ObjCClassExt (ObjCClassListDef a)
| ObjCProtoExt (ObjCProtocolDec a)
| ObjCCatExt (ObjCCategoryDec a)
| ObjCCatImplExt (ObjCCategoryImplementation a)
| CAsmExt (CStringLiteral a) a
deriving (Show, Data,Typeable )
type CFunDef = CFunctionDef NodeInfo
data CFunctionDef a
= CFunDef
[CDeclarationSpecifier a]
(CDeclarator a)
[CDeclaration a]
(CStatement a)
a
deriving (Show, Data,Typeable )
type ObjCCatDec = ObjCCategoryDec NodeInfo
data ObjCCategoryDec a =
ObjCCatDec
!Ident
!Ident
[ObjCProtocolName a]
[ObjCInterfaceDeclaration a]
[CAttribute a]
a
deriving (Show, Data, Typeable, Functor )
type ObjCCatImpl = ObjCCategoryImplementation NodeInfo
data ObjCCategoryImplementation a =
ObjCCatImpl
!Ident
!Ident
[ObjCImplementationDefinition a]
a
deriving (Show, Data, Typeable, Functor )
type ObjCClassDef = ObjCClassListDef NodeInfo
data ObjCClassListDef a =
ObjCClassDef [ObjCClassDeclarator a] a
deriving (Show, Data, Typeable )
type ObjCProtoDec = ObjCProtocolDec NodeInfo
data ObjCProtocolDec a =
ObjCForwardProtoDec [Ident] [CAttribute a] a
| ObjCProtoDec !Ident
[ObjCProtocolName a]
[ObjCProtocolDeclBlock a]
[CAttribute a]
a
deriving (Show, Data, Typeable )
type ObjCProtoDeclBlock = ObjCProtocolDeclBlock NodeInfo
data ObjCProtocolDeclBlock a =
ObjCProtoDeclBlock [ObjCInterfaceDeclaration a] a
| ObjCReqProtoBlock [ObjCInterfaceDeclaration a] a
| ObjCOptProtoBlock [ObjCInterfaceDeclaration a] a
deriving (Show, Data, Typeable )
type ObjCIface = ObjCInterface NodeInfo
data ObjCInterface a =
ObjCIface
(ObjCClassDeclarator a)
(Maybe (ObjCClassName a))
[ObjCProtocolName a]
[ObjCInstanceVariableBlock a]
[ObjCInterfaceDeclaration a]
[CAttribute a]
a
deriving (Show, Data, Typeable, Functor )
type ObjCImpl = ObjCImplementation NodeInfo
data ObjCImplementation a =
ObjCImpl
(ObjCClassName a)
(Maybe (ObjCClassName a))
[ObjCInstanceVariableBlock a]
[ObjCImplementationDefinition a]
a
deriving (Show, Data, Typeable, Functor )
type ObjCClassDeclr = ObjCClassDeclarator NodeInfo
data ObjCClassDeclarator a =
ObjCClassDeclr !Ident a
deriving (Show, Data, Typeable, Functor )
type ObjCClassNm = ObjCClassName NodeInfo
data ObjCClassName a = ObjCClassNm !Ident a
deriving (Show, Data, Typeable, Functor )
type ObjCProtoNm = ObjCProtocolName NodeInfo
data ObjCProtocolName a = ObjCProtoNm !Ident a
deriving (Show, Data, Typeable, Functor )
type ObjCInstanceVarBlock = ObjCInstanceVariableBlock NodeInfo
data ObjCInstanceVariableBlock a =
ObjCInstanceVarBlock
(Maybe (ObjCVisibilitySpec a))
[CDeclaration a]
a
deriving (Show, Data, Typeable, Functor )
type ObjCVisSpec = ObjCVisibilitySpec NodeInfo
data ObjCVisibilitySpec a =
ObjCVisSpec !ObjCVisType a
deriving (Show, Data, Typeable, Functor )
data ObjCVisType =
ObjCPrivVis
| ObjCProtVis
| ObjCPubVis
| ObjCPackageVis
deriving (Show, Data, Typeable, Enum)
type ObjCIfaceDecl = ObjCInterfaceDeclaration NodeInfo
data ObjCInterfaceDeclaration a =
ObjCIfaceDecl (CDeclaration a) a
| ObjCIfaceMethodDecl (ObjCMethodDeclaration a) a
| ObjCIfacePropDecl (ObjCPropertyDeclaration a) a
deriving (Show, Data, Typeable, Functor )
type ObjCImplDef = ObjCImplementationDefinition NodeInfo
data ObjCImplementationDefinition a =
ObjCImplDec (CDeclaration a)
| ObjCImplMethod (ObjCMethodDefinition a)
| ObjCImplFun (CFunctionDef a)
deriving (Show, Data, Typeable, Functor )
type ObjCMethodDecl = ObjCMethodDeclaration NodeInfo
data ObjCMethodDeclaration a =
ObjCMethodDecl
!ObjCMethodType
(Maybe (CDeclaration a))
(ObjCMethodSelector a)
[CAttribute a]
a
deriving (Show, Data, Typeable, Functor )
type ObjCMethodDef = ObjCMethodDefinition NodeInfo
data ObjCMethodDefinition a =
ObjCMethodDef
!ObjCMethodType
(Maybe (CDeclaration a))
(ObjCMethodSelector a)
[CDeclaration a]
(CStatement a)
a
deriving (Show, Data, Typeable, Functor )
data ObjCMethodType = ObjCClassMethod | ObjCInstanceMethod
deriving (Show, Data, Typeable, Enum)
type ObjCMethodSel = ObjCMethodSelector NodeInfo
data ObjCMethodSelector a =
ObjCUnaryMethod (ObjCSelector a) a
| ObjCMethod [ObjCKeywordDeclarator a] (Maybe ([CDeclaration a],Bool)) a
| ObjCEllipseMethod [ObjCKeywordDeclarator a] a
deriving (Show, Data, Typeable, Functor )
type ObjCKeyDeclr = ObjCKeywordDeclarator NodeInfo
data ObjCKeywordDeclarator a =
ObjCKeyDeclr
(Maybe (ObjCSelector a))
(Maybe (CDeclaration a))
!Ident
a
deriving (Show, Data, Typeable, Functor )
type ObjCPropDecl = ObjCPropertyDeclaration NodeInfo
data ObjCPropertyDeclaration a =
ObjCPropDecl
[ObjCPropertyModifier a]
(CDeclaration a)
a
deriving (Show, Data, Typeable, Functor )
type ObjCPropMod = ObjCPropertyModifier NodeInfo
data ObjCPropertyModifier a =
ObjCPropMod !Ident (Maybe Ident) a
deriving (Show, Data, Typeable, Functor )
type CDecl = CDeclaration NodeInfo
data CDeclaration a
= CDecl
[CDeclarationSpecifier a]
[(Maybe (CDeclarator a),
Maybe (CInitializer a),
Maybe (CExpression a))]
a
deriving (Show, Data,Typeable )
instance Functor CDeclaration where
fmap f (CDecl specs declarators annot) =
CDecl (map (fmap f) specs) (map fmap3m declarators) (f annot)
where fmap3m (a,b,c) = (fmap (fmap f) a, fmap (fmap f) b, fmap (fmap f) c)
type CDeclr = CDeclarator NodeInfo
data CDeclarator a
= CDeclr (Maybe Ident) [CDerivedDeclarator a] (Maybe (CStringLiteral a)) [CAttribute a] a
deriving (Show, Data,Typeable )
type CDerivedDeclr = CDerivedDeclarator NodeInfo
data CDerivedDeclarator a
= CPtrDeclr [CTypeQualifier a] a
| CBlkDeclr [CTypeQualifier a] a
| CArrDeclr [CTypeQualifier a] (CArraySize a) a
| CFunDeclr (Either [Ident] ([CDeclaration a],Bool)) [CAttribute a] a
deriving (Show, Data,Typeable )
instance Functor CDerivedDeclarator where
fmap _f (CPtrDeclr a1 a2) = CPtrDeclr (fmap (fmap _f) a1) (_f a2)
fmap _f (CBlkDeclr a1 a2) = CBlkDeclr (fmap (fmap _f) a1) (_f a2)
fmap _f (CArrDeclr a1 a2 a3)
= CArrDeclr (fmap (fmap _f) a1) (fmap _f a2) (_f a3)
fmap _f (CFunDeclr a1 a2 a3)
= CFunDeclr (fmap (fmapFirst (fmap (fmap _f))) a1) (fmap (fmap _f) a2)
(_f a3)
where fmapFirst f (a,b) = (f a, b)
type CArrSize = CArraySize NodeInfo
data CArraySize a
= CNoArrSize !Bool
| CArrSize !Bool (CExpression a)
deriving (Show, Data,Typeable )
type CStat = CStatement NodeInfo
data CStatement a
= CLabel !Ident (CStatement a) [CAttribute a] a
| CCase (CExpression a) (CStatement a) a
| CCases (CExpression a) (CExpression a) (CStatement a) a
| CDefault (CStatement a) a
| CExpr (Maybe (CExpression a)) a
| CCompound [Ident] [CCompoundBlockItem a] a
| CIf (CExpression a) (CStatement a) (Maybe (CStatement a)) a
| CSwitch (CExpression a) (CStatement a) a
| CWhile (CExpression a) (CStatement a) Bool a
| CFor (Either (Maybe (CExpression a)) (CDeclaration a))
(Maybe (CExpression a))
(Maybe (CExpression a))
(CStatement a)
a
| CGoto !Ident a
| CGotoPtr (CExpression a) a
| CCont a
| CBreak a
| CReturn (Maybe (CExpression a)) a
| CAsm (CAssemblyStatement a) a
deriving (Show, Data,Typeable )
instance Functor CStatement where
fmap _f (CLabel a1 a2 a3 a4)
= CLabel a1 (fmap _f a2) (fmap (fmap _f) a3) (_f a4)
fmap _f (CCase a1 a2 a3) = CCase (fmap _f a1) (fmap _f a2) (_f a3)
fmap _f (CCases a1 a2 a3 a4)
= CCases (fmap _f a1) (fmap _f a2) (fmap _f a3) (_f a4)
fmap _f (CDefault a1 a2) = CDefault (fmap _f a1) (_f a2)
fmap _f (CExpr a1 a2) = CExpr (fmap (fmap _f) a1) (_f a2)
fmap _f (CCompound a1 a2 a3)
= CCompound a1 (fmap (fmap _f) a2) (_f a3)
fmap _f (CIf a1 a2 a3 a4)
= CIf (fmap _f a1) (fmap _f a2) (fmap (fmap _f) a3) (_f a4)
fmap _f (CSwitch a1 a2 a3)
= CSwitch (fmap _f a1) (fmap _f a2) (_f a3)
fmap _f (CWhile a1 a2 a3 a4)
= CWhile (fmap _f a1) (fmap _f a2) a3 (_f a4)
fmap _f (CFor a1 a2 a3 a4 a5)
= CFor (mapEither (fmap (fmap _f)) (fmap _f) a1)
(fmap (fmap _f) a2) (fmap (fmap _f) a3) (fmap _f a4)
(_f a5)
where mapEither f1 f2 = either (Left . f1) (Right . f2)
fmap _f (CGoto a1 a2) = CGoto a1 (_f a2)
fmap _f (CGotoPtr a1 a2) = CGotoPtr (fmap _f a1) (_f a2)
fmap _f (CCont a1) = CCont (_f a1)
fmap _f (CBreak a1) = CBreak (_f a1)
fmap _f (CReturn a1 a2) = CReturn (fmap (fmap _f) a1) (_f a2)
fmap _f (CAsm a1 a2) = CAsm (fmap _f a1) (_f a2)
type CAsmStmt = CAssemblyStatement NodeInfo
data CAssemblyStatement a
= CAsmStmt
(Maybe (CTypeQualifier a))
(CStringLiteral a)
[CAssemblyOperand a]
[CAssemblyOperand a]
[CStringLiteral a]
a
deriving (Show, Data,Typeable )
type CAsmOperand = CAssemblyOperand NodeInfo
data CAssemblyOperand a
= CAsmOperand
(Maybe Ident)
(CStringLiteral a)
(CExpression a)
a
deriving (Show, Data,Typeable )
type CBlockItem = CCompoundBlockItem NodeInfo
data CCompoundBlockItem a
= CBlockStmt (CStatement a)
| CBlockDecl (CDeclaration a)
| CNestedFunDef (CFunctionDef a)
deriving (Show, Data,Typeable )
type CDeclSpec = CDeclarationSpecifier NodeInfo
data CDeclarationSpecifier a
= CStorageSpec (CStorageSpecifier a)
| CTypeSpec (CTypeSpecifier a)
| CTypeQual (CTypeQualifier a)
deriving (Show, Data,Typeable )
partitionDeclSpecs :: [CDeclarationSpecifier a]
-> ( [CStorageSpecifier a], [CAttribute a]
, [CTypeQualifier a], [CTypeSpecifier a], Bool)
partitionDeclSpecs = foldr deals ([],[],[],[],False) where
deals (CTypeQual (CInlineQual _)) (sts,ats,tqs,tss,_) = (sts,ats,tqs,tss,True)
deals (CStorageSpec sp) (sts,ats,tqs,tss,inline) = (sp:sts,ats,tqs,tss,inline)
deals (CTypeQual (CAttrQual attr)) (sts,ats,tqs,tss,inline) = (sts,attr:ats,tqs,tss,inline)
deals (CTypeQual tq) (sts,ats,tqs,tss,inline) = (sts,ats,tq:tqs,tss,inline)
deals (CTypeSpec ts) (sts,ats,tqs,tss,inline) = (sts,ats,tqs,ts:tss,inline)
type CStorageSpec = CStorageSpecifier NodeInfo
data CStorageSpecifier a
= CAuto a
| CRegister a
| CStatic a
| CExtern a
| CTypedef a
| CThread a
deriving (Show, Eq,Ord,Data,Typeable )
type CTypeSpec = CTypeSpecifier NodeInfo
data CTypeSpecifier a
= CVoidType a
| CCharType a
| CShortType a
| CIntType a
| CLongType a
| CFloatType a
| CDoubleType a
| CSignedType a
| CUnsigType a
| CBoolType a
| CComplexType a
| CSUType (CStructureUnion a) a
| CEnumType (CEnumeration a) a
| CTypeDef !Ident a
| CTypeOfExpr (CExpression a) a
| CTypeOfType (CDeclaration a) a
| ObjCClassProto !Ident [ObjCProtocolName a] a
| ObjCTypeProto !Ident [ObjCProtocolName a] a
deriving (Show, Data,Typeable )
isSUEDef :: CTypeSpecifier a -> Bool
isSUEDef (CSUType (CStruct _ _ (Just _) _ _) _) = True
isSUEDef (CEnumType (CEnum _ (Just _) _ _) _) = True
isSUEDef _ = False
type CTypeQual = CTypeQualifier NodeInfo
data CTypeQualifier a
= CConstQual a
| CVolatQual a
| CRestrQual a
| CInlineQual a
| CAttrQual (CAttribute a)
| ObjCProtoQual (ObjCProtoQualifier a)
deriving (Show, Data,Typeable )
type ObjCProtoQual = ObjCProtoQualifier NodeInfo
data ObjCProtoQualifier a =
ObjCInQual a
| ObjCOutQual a
| ObjCInOutQual a
| ObjCBycopyQual a
| ObjCOnewayQual a
deriving (Show, Data, Typeable, Functor )
type CStructUnion = CStructureUnion NodeInfo
data CStructureUnion a
= CStruct
!CStructTag
(Maybe Ident)
(Maybe [CDeclaration a])
[CAttribute a]
a
deriving (Show, Data,Typeable )
data CStructTag = CStructTag
| CUnionTag
deriving (Show, Eq,Data,Typeable)
type CEnum = CEnumeration NodeInfo
data CEnumeration a
= CEnum
(Maybe Ident)
(Maybe [(Ident,
Maybe (CExpression a))])
[CAttribute a]
a
deriving (Show, Data,Typeable )
type CInit = CInitializer NodeInfo
data CInitializer a
= CInitExpr (CExpression a) a
| CInitList (CInitializerList a) a
deriving (Show, Data,Typeable )
instance Functor CInitializer where
fmap _f (CInitExpr a1 a2) = CInitExpr (fmap _f a1) (_f a2)
fmap _f (CInitList a1 a2) = CInitList (fmapInitList _f a1) (_f a2)
fmapInitList :: (a->b) -> (CInitializerList a) -> (CInitializerList b)
fmapInitList _f = map (\(desigs, initializer) -> (fmap (fmap _f) desigs, fmap _f initializer))
type CInitList = CInitializerList NodeInfo
type CInitializerList a = [([CPartDesignator a], CInitializer a)]
type CDesignator = CPartDesignator NodeInfo
data CPartDesignator a
= CArrDesig (CExpression a) a
| CMemberDesig !Ident a
| CRangeDesig (CExpression a) (CExpression a) a
deriving (Show, Data,Typeable )
type CAttr = CAttribute NodeInfo
data CAttribute a = CAttr !Ident [CExpression a] a
deriving (Show, Data,Typeable )
type CExpr = CExpression NodeInfo
data CExpression a
= CComma [CExpression a]
a
| CAssign !CAssignOp
(CExpression a)
(CExpression a)
a
| CCond (CExpression a)
(Maybe (CExpression a))
(CExpression a)
a
| CBinary CBinaryOp
(CExpression a)
(CExpression a)
a
| CCast (CDeclaration a)
(CExpression a)
a
| CUnary CUnaryOp
(CExpression a)
a
| CSizeofExpr (CExpression a)
a
| CSizeofType (CDeclaration a)
a
| CAlignofExpr (CExpression a)
a
| CAlignofType (CDeclaration a)
a
| CComplexReal (CExpression a)
a
| CComplexImag (CExpression a)
a
| CIndex (CExpression a)
(CExpression a)
a
| CCall (CExpression a)
[CExpression a]
a
| CMember (CExpression a)
!Ident
!Bool
a
| CVar !Ident
a
| CConst (CConstant a)
| CCompoundLit (CDeclaration a)
(CInitializerList a)
a
| CStatExpr (CStatement a) a
| CLabAddrExpr !Ident a
| CBuiltinExpr (CBuiltinThing a)
| CBlockExpr ([CDeclaration a],Bool) (CStatement a) a
| ObjCMessageExpr (ObjCMessageExpression a) a
| ObjCSelectorExpr (ObjCSelectorName a) a
| ObjCProtoExpr Ident a
| ObjCEncodeExpr (CDeclaration a) a
| ObjCConst (ObjCConstant a)
deriving (Data,Typeable,Show, Functor )
type ObjCSelName = ObjCSelectorName NodeInfo
data ObjCSelectorName a =
ObjCSelPlain (ObjCSelector a) a
| ObjCSelKeys [ObjCSelectorKeyName a] a
deriving (Data,Typeable,Show, Functor )
type ObjCSelKeyName = ObjCSelectorKeyName NodeInfo
data ObjCSelectorKeyName a =
ObjCSelKeyName (Maybe (ObjCSelector a)) a
deriving (Data,Typeable,Show, Functor )
type ObjCSel = ObjCSelector NodeInfo
data ObjCSelector a =
ObjCSel Ident a
| ObjCInSel a
| ObjCOutSel a
deriving (Data,Typeable,Show, Functor )
type ObjCMsgExpr = ObjCMessageExpression NodeInfo
data ObjCMessageExpression a =
ObjCMsgExpr (CExpression a) (ObjCMessageSelector a) a
| ObjCMsgClass (ObjCClassName a) (ObjCMessageSelector a) a
| ObjCMsgSup (ObjCMessageSelector a) a
deriving (Data,Typeable,Show, Functor )
type ObjCMsgSel = ObjCMessageSelector NodeInfo
data ObjCMessageSelector a =
ObjCMsgSel (ObjCSelector a) a
| ObjCKeyArgs [ObjCKeywordArg a] a
deriving (Data,Typeable,Show, Functor )
type ObjCKeyArg = ObjCKeywordArg NodeInfo
data ObjCKeywordArg a =
ObjCKeyArg (ObjCSelectorKeyName a) (CExpression a) a
deriving (Data,Typeable,Show, Functor )
type CBuiltin = CBuiltinThing NodeInfo
data CBuiltinThing a
= CBuiltinVaArg (CExpression a) (CDeclaration a) a
| CBuiltinOffsetOf (CDeclaration a) [CPartDesignator a] a
| CBuiltinTypesCompatible (CDeclaration a) (CDeclaration a) a
deriving (Show, Data,Typeable )
type ObjCConst = ObjCConstant NodeInfo
data ObjCConstant a
= ObjCStrConst CString a
deriving (Show, Data, Typeable, Functor )
type CConst = CConstant NodeInfo
data CConstant a
= CIntConst CInteger a
| CCharConst CChar a
| CFloatConst CFloat a
| CStrConst CString a
deriving (Show, Data,Typeable )
type CStrLit = CStringLiteral NodeInfo
data CStringLiteral a = CStrLit CString a
deriving (Show, Data,Typeable )
cstringOfLit :: CStringLiteral a -> CString
cstringOfLit (CStrLit cstr _) = cstr
liftStrLit :: CStringLiteral a -> CConstant a
liftStrLit (CStrLit str at) = CStrConst str at
class (Functor ast) => Annotated ast where
annotation :: ast a -> a
amap :: (a->a) -> ast a -> ast a
instance (CNode t1) => CNode (CTranslationUnit t1) where
nodeInfo (CTranslUnit _ n) = nodeInfo n
instance (CNode t1) => Pos (CTranslationUnit t1) where
posOf x = posOf (nodeInfo x)
instance Functor CTranslationUnit where
fmap _f (CTranslUnit a1 a2)
= CTranslUnit (fmap (fmap _f) a1) (_f a2)
instance Annotated CTranslationUnit where
annotation (CTranslUnit _ n) = n
amap f (CTranslUnit a_1 a_2) = CTranslUnit a_1 (f a_2)
instance (CNode t1) => CNode (CExternalDeclaration t1) where
nodeInfo (CDeclExt d) = nodeInfo d
nodeInfo (CFDefExt d) = nodeInfo d
nodeInfo (ObjCIfaceExt d) = nodeInfo d
nodeInfo (ObjCImplExt d) = nodeInfo d
nodeInfo (ObjCClassExt d) = nodeInfo d
nodeInfo (ObjCProtoExt d) = nodeInfo d
nodeInfo (ObjCCatExt d) = nodeInfo d
nodeInfo (ObjCCatImplExt d) = nodeInfo d
nodeInfo (CAsmExt _ n) = nodeInfo n
instance (CNode t1) => Pos (CExternalDeclaration t1) where
posOf x = posOf (nodeInfo x)
instance Functor CExternalDeclaration where
fmap _f (CDeclExt a1) = CDeclExt (fmap _f a1)
fmap _f (CFDefExt a1) = CFDefExt (fmap _f a1)
fmap _f (ObjCIfaceExt a1) = ObjCIfaceExt (fmap _f a1)
fmap _f (ObjCImplExt a1) = ObjCImplExt (fmap _f a1)
fmap _f (ObjCClassExt a1) = ObjCClassExt (fmap _f a1)
fmap _f (ObjCProtoExt a1) = ObjCProtoExt (fmap _f a1)
fmap _f (ObjCCatExt a1) = ObjCCatExt (fmap _f a1)
fmap _f (ObjCCatImplExt a1) = ObjCCatImplExt (fmap _f a1)
fmap _f (CAsmExt a1 a2) = CAsmExt (fmap _f a1) (_f a2)
instance Annotated CExternalDeclaration where
annotation (CDeclExt n) = annotation n
annotation (CFDefExt n) = annotation n
annotation (ObjCIfaceExt n) = annotation n
annotation (ObjCImplExt n) = annotation n
annotation (ObjCClassExt n) = annotation n
annotation (ObjCProtoExt n) = annotation n
annotation (ObjCCatExt n) = annotation n
annotation (ObjCCatImplExt n) = annotation n
annotation (CAsmExt _ n) = n
amap f (CDeclExt n) = CDeclExt (amap f n)
amap f (CFDefExt n) = CFDefExt (amap f n)
amap f (ObjCIfaceExt n) = ObjCIfaceExt (amap f n)
amap f (ObjCImplExt n) = ObjCImplExt (amap f n)
amap f (ObjCClassExt n) = ObjCClassExt (amap f n)
amap f (ObjCProtoExt n) = ObjCProtoExt (amap f n)
amap f (ObjCCatExt n) = ObjCCatExt (amap f n)
amap f (ObjCCatImplExt n) = ObjCCatImplExt (amap f n)
amap f (CAsmExt a_1 a_2) = CAsmExt a_1 (f a_2)
instance (CNode t1) => CNode (CFunctionDef t1) where
nodeInfo (CFunDef _ _ _ _ n) = nodeInfo n
instance (CNode t1) => Pos (CFunctionDef t1) where
posOf x = posOf (nodeInfo x)
instance Functor CFunctionDef where
fmap _f (CFunDef a1 a2 a3 a4 a5)
= CFunDef (fmap (fmap _f) a1) (fmap _f a2) (fmap (fmap _f) a3)
(fmap _f a4)
(_f a5)
instance Annotated CFunctionDef where
annotation (CFunDef _ _ _ _ n) = n
amap f (CFunDef a_1 a_2 a_3 a_4 a_5)
= CFunDef a_1 a_2 a_3 a_4 (f a_5)
instance (CNode t1) => CNode (ObjCCategoryDec t1) where
nodeInfo (ObjCCatDec _ _ _ _ _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCCategoryDec t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCCategoryDec where
annotation (ObjCCatDec _ _ _ _ _ n) = n
amap f (ObjCCatDec a_1 a_2 a_3 a_4 a_5 a_6)
= ObjCCatDec a_1 a_2 a_3 a_4 a_5 (f a_6)
instance (CNode t1) => CNode (ObjCCategoryImplementation t1) where
nodeInfo (ObjCCatImpl _ _ _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCCategoryImplementation t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCCategoryImplementation where
annotation (ObjCCatImpl _ _ _ n) = n
amap f (ObjCCatImpl a_1 a_2 a_3 a_4)
= ObjCCatImpl a_1 a_2 a_3 (f a_4)
instance (CNode t1) => CNode (ObjCClassListDef t1) where
nodeInfo (ObjCClassDef _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCClassListDef t1) where
posOf x = posOf (nodeInfo x)
instance Functor ObjCClassListDef where
fmap _f (ObjCClassDef a1 a2)
= ObjCClassDef (fmap (fmap _f) a1) (_f a2)
instance Annotated ObjCClassListDef where
annotation (ObjCClassDef _ n) = n
amap f (ObjCClassDef a_1 a_2) = ObjCClassDef a_1 (f a_2)
instance (CNode t1) => CNode (ObjCProtocolDec t1) where
nodeInfo (ObjCForwardProtoDec _ _ n) = nodeInfo n
nodeInfo (ObjCProtoDec _ _ _ _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCProtocolDec t1) where
posOf x = posOf (nodeInfo x)
instance Functor ObjCProtocolDec where
fmap _f (ObjCForwardProtoDec a1 a2 a3)
= ObjCForwardProtoDec a1 (fmap (fmap _f) a2) (_f a3)
fmap _f (ObjCProtoDec a1 a2 a3 a4 a5)
= ObjCProtoDec a1 (fmap (fmap _f) a2) (fmap (fmap _f) a3)
(fmap (fmap _f) a4)
(_f a5)
instance Annotated ObjCProtocolDec where
annotation (ObjCForwardProtoDec _ _ n) = n
annotation (ObjCProtoDec _ _ _ _ n) = n
amap f (ObjCForwardProtoDec a_1 a_2 a_3)
= ObjCForwardProtoDec a_1 a_2 (f a_3)
amap f (ObjCProtoDec a_1 a_2 a_3 a_4 a_5)
= ObjCProtoDec a_1 a_2 a_3 a_4 (f a_5)
instance (CNode t1) => CNode (ObjCProtocolDeclBlock t1) where
nodeInfo (ObjCProtoDeclBlock _ n) = nodeInfo n
nodeInfo (ObjCReqProtoBlock _ n) = nodeInfo n
nodeInfo (ObjCOptProtoBlock _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCProtocolDeclBlock t1) where
posOf x = posOf (nodeInfo x)
instance Functor ObjCProtocolDeclBlock where
fmap _f (ObjCProtoDeclBlock a1 a2)
= ObjCProtoDeclBlock (fmap (fmap _f) a1) (_f a2)
fmap _f (ObjCReqProtoBlock a1 a2)
= ObjCReqProtoBlock (fmap (fmap _f) a1) (_f a2)
fmap _f (ObjCOptProtoBlock a1 a2)
= ObjCOptProtoBlock (fmap (fmap _f) a1) (_f a2)
instance Annotated ObjCProtocolDeclBlock where
annotation (ObjCProtoDeclBlock _ n) = n
annotation (ObjCReqProtoBlock _ n) = n
annotation (ObjCOptProtoBlock _ n) = n
amap f (ObjCProtoDeclBlock a_1 a_2)
= ObjCProtoDeclBlock a_1 (f a_2)
amap f (ObjCReqProtoBlock a_1 a_2) = ObjCReqProtoBlock a_1 (f a_2)
amap f (ObjCOptProtoBlock a_1 a_2) = ObjCOptProtoBlock a_1 (f a_2)
instance (CNode t1) => CNode (ObjCInterface t1) where
nodeInfo (ObjCIface _ _ _ _ _ _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCInterface t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCInterface where
annotation (ObjCIface _ _ _ _ _ _ n) = n
amap f (ObjCIface a_1 a_2 a_3 a_4 a_5 a_6 a_7)
= ObjCIface a_1 a_2 a_3 a_4 a_5 a_6 (f a_7)
instance (CNode t1) => CNode (ObjCImplementation t1) where
nodeInfo (ObjCImpl _ _ _ _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCImplementation t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCImplementation where
annotation (ObjCImpl _ _ _ _ n) = n
amap f (ObjCImpl a_1 a_2 a_3 a_4 a_5)
= ObjCImpl a_1 a_2 a_3 a_4 (f a_5)
instance (CNode t1) => CNode (ObjCClassDeclarator t1) where
nodeInfo (ObjCClassDeclr _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCClassDeclarator t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCClassDeclarator where
annotation (ObjCClassDeclr _ n) = n
amap f (ObjCClassDeclr a_1 a_2) = ObjCClassDeclr a_1 (f a_2)
instance (CNode t1) => CNode (ObjCClassName t1) where
nodeInfo (ObjCClassNm _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCClassName t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCClassName where
annotation (ObjCClassNm _ n) = n
amap f (ObjCClassNm a_1 a_2) = ObjCClassNm a_1 (f a_2)
instance (CNode t1) => CNode (ObjCProtocolName t1) where
nodeInfo (ObjCProtoNm _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCProtocolName t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCProtocolName where
annotation (ObjCProtoNm _ n) = n
amap f (ObjCProtoNm a_1 a_2) = ObjCProtoNm a_1 (f a_2)
instance (CNode t1) => CNode (ObjCInstanceVariableBlock t1) where
nodeInfo (ObjCInstanceVarBlock _ _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCInstanceVariableBlock t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCInstanceVariableBlock where
annotation (ObjCInstanceVarBlock _ _ n) = n
amap f (ObjCInstanceVarBlock a_1 a_2 a_3)
= ObjCInstanceVarBlock a_1 a_2 (f a_3)
instance (CNode t1) => CNode (ObjCVisibilitySpec t1) where
nodeInfo (ObjCVisSpec _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCVisibilitySpec t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCVisibilitySpec where
annotation (ObjCVisSpec _ n) = n
amap f (ObjCVisSpec a_1 a_2) = ObjCVisSpec a_1 (f a_2)
instance (CNode t1) => CNode (ObjCInterfaceDeclaration t1) where
nodeInfo (ObjCIfaceDecl _ n) = nodeInfo n
nodeInfo (ObjCIfaceMethodDecl _ n) = nodeInfo n
nodeInfo (ObjCIfacePropDecl _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCInterfaceDeclaration t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCInterfaceDeclaration where
annotation (ObjCIfaceDecl _ n) = n
annotation (ObjCIfaceMethodDecl _ n) = n
annotation (ObjCIfacePropDecl _ n) = n
amap f (ObjCIfaceDecl a_1 a_2) = ObjCIfaceDecl a_1 (f a_2)
amap f (ObjCIfaceMethodDecl a_1 a_2)
= ObjCIfaceMethodDecl a_1 (f a_2)
amap f (ObjCIfacePropDecl a_1 a_2) = ObjCIfacePropDecl a_1 (f a_2)
instance (CNode t1) => CNode (ObjCImplementationDefinition t1)
where
nodeInfo (ObjCImplDec d) = nodeInfo d
nodeInfo (ObjCImplMethod d) = nodeInfo d
nodeInfo (ObjCImplFun d) = nodeInfo d
instance (CNode t1) => Pos (ObjCImplementationDefinition t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCImplementationDefinition where
annotation (ObjCImplDec n) = annotation n
annotation (ObjCImplMethod n) = annotation n
annotation (ObjCImplFun n) = annotation n
amap f (ObjCImplDec n) = ObjCImplDec (amap f n)
amap f (ObjCImplMethod n) = ObjCImplMethod (amap f n)
amap f (ObjCImplFun n) = ObjCImplFun (amap f n)
instance (CNode t1) => CNode (ObjCMethodDeclaration t1) where
nodeInfo (ObjCMethodDecl _ _ _ _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCMethodDeclaration t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCMethodDeclaration where
annotation (ObjCMethodDecl _ _ _ _ n) = n
amap f (ObjCMethodDecl a_1 a_2 a_3 a_4 a_5)
= ObjCMethodDecl a_1 a_2 a_3 a_4 (f a_5)
instance (CNode t1) => CNode (ObjCMethodDefinition t1) where
nodeInfo (ObjCMethodDef _ _ _ _ _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCMethodDefinition t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCMethodDefinition where
annotation (ObjCMethodDef _ _ _ _ _ n) = n
amap f (ObjCMethodDef a_1 a_2 a_3 a_4 a_5 a_6)
= ObjCMethodDef a_1 a_2 a_3 a_4 a_5 (f a_6)
instance (CNode t1) => CNode (ObjCMethodSelector t1) where
nodeInfo (ObjCUnaryMethod _ n) = nodeInfo n
nodeInfo (ObjCMethod _ _ n) = nodeInfo n
nodeInfo (ObjCEllipseMethod _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCMethodSelector t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCMethodSelector where
annotation (ObjCUnaryMethod _ n) = n
annotation (ObjCMethod _ _ n) = n
annotation (ObjCEllipseMethod _ n) = n
amap f (ObjCUnaryMethod a_1 a_2) = ObjCUnaryMethod a_1 (f a_2)
amap f (ObjCMethod a_1 a_2 a_3) = ObjCMethod a_1 a_2 (f a_3)
amap f (ObjCEllipseMethod a_1 a_2) = ObjCEllipseMethod a_1 (f a_2)
instance (CNode t1) => CNode (ObjCKeywordDeclarator t1) where
nodeInfo (ObjCKeyDeclr _ _ _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCKeywordDeclarator t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCKeywordDeclarator where
annotation (ObjCKeyDeclr _ _ _ n) = n
amap f (ObjCKeyDeclr a_1 a_2 a_3 a_4)
= ObjCKeyDeclr a_1 a_2 a_3 (f a_4)
instance (CNode t1) => CNode (ObjCPropertyDeclaration t1) where
nodeInfo (ObjCPropDecl _ _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCPropertyDeclaration t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCPropertyDeclaration where
annotation (ObjCPropDecl _ _ n) = n
amap f (ObjCPropDecl a_1 a_2 a_3) = ObjCPropDecl a_1 a_2 (f a_3)
instance (CNode t1) => CNode (ObjCPropertyModifier t1) where
nodeInfo (ObjCPropMod _ _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCPropertyModifier t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCPropertyModifier where
annotation (ObjCPropMod _ _ n) = n
amap f (ObjCPropMod a_1 a_2 a_3) = ObjCPropMod a_1 a_2 (f a_3)
instance (CNode t1) => CNode (CDeclaration t1) where
nodeInfo (CDecl _ _ n) = nodeInfo n
instance (CNode t1) => Pos (CDeclaration t1) where
posOf x = posOf (nodeInfo x)
instance Annotated CDeclaration where
annotation (CDecl _ _ n) = n
amap f (CDecl a_1 a_2 a_3) = CDecl a_1 a_2 (f a_3)
instance (CNode t1) => CNode (CDeclarator t1) where
nodeInfo (CDeclr _ _ _ _ n) = nodeInfo n
instance (CNode t1) => Pos (CDeclarator t1) where
posOf x = posOf (nodeInfo x)
instance Functor CDeclarator where
fmap _f (CDeclr a1 a2 a3 a4 a5)
= CDeclr a1 (fmap (fmap _f) a2) (fmap (fmap _f) a3)
(fmap (fmap _f) a4)
(_f a5)
instance Annotated CDeclarator where
annotation (CDeclr _ _ _ _ n) = n
amap f (CDeclr a_1 a_2 a_3 a_4 a_5)
= CDeclr a_1 a_2 a_3 a_4 (f a_5)
instance (CNode t1) => CNode (CDerivedDeclarator t1) where
nodeInfo (CPtrDeclr _ n) = nodeInfo n
nodeInfo (CBlkDeclr _ n) = nodeInfo n
nodeInfo (CArrDeclr _ _ n) = nodeInfo n
nodeInfo (CFunDeclr _ _ n) = nodeInfo n
instance (CNode t1) => Pos (CDerivedDeclarator t1) where
posOf x = posOf (nodeInfo x)
instance Annotated CDerivedDeclarator where
annotation (CPtrDeclr _ n) = n
annotation (CBlkDeclr _ n) = n
annotation (CArrDeclr _ _ n) = n
annotation (CFunDeclr _ _ n) = n
amap f (CPtrDeclr a_1 a_2) = CPtrDeclr a_1 (f a_2)
amap f (CBlkDeclr a_1 a_2) = CBlkDeclr a_1 (f a_2)
amap f (CArrDeclr a_1 a_2 a_3) = CArrDeclr a_1 a_2 (f a_3)
amap f (CFunDeclr a_1 a_2 a_3) = CFunDeclr a_1 a_2 (f a_3)
instance Functor CArraySize where
fmap _ (CNoArrSize a1) = CNoArrSize a1
fmap _f (CArrSize a1 a2) = CArrSize a1 (fmap _f a2)
instance (CNode t1) => CNode (CStatement t1) where
nodeInfo (CLabel _ _ _ n) = nodeInfo n
nodeInfo (CCase _ _ n) = nodeInfo n
nodeInfo (CCases _ _ _ n) = nodeInfo n
nodeInfo (CDefault _ n) = nodeInfo n
nodeInfo (CExpr _ n) = nodeInfo n
nodeInfo (CCompound _ _ n) = nodeInfo n
nodeInfo (CIf _ _ _ n) = nodeInfo n
nodeInfo (CSwitch _ _ n) = nodeInfo n
nodeInfo (CWhile _ _ _ n) = nodeInfo n
nodeInfo (CFor _ _ _ _ n) = nodeInfo n
nodeInfo (CGoto _ n) = nodeInfo n
nodeInfo (CGotoPtr _ n) = nodeInfo n
nodeInfo (CCont d) = nodeInfo d
nodeInfo (CBreak d) = nodeInfo d
nodeInfo (CReturn _ n) = nodeInfo n
nodeInfo (CAsm _ n) = nodeInfo n
instance (CNode t1) => Pos (CStatement t1) where
posOf x = posOf (nodeInfo x)
instance Annotated CStatement where
annotation (CLabel _ _ _ n) = n
annotation (CCase _ _ n) = n
annotation (CCases _ _ _ n) = n
annotation (CDefault _ n) = n
annotation (CExpr _ n) = n
annotation (CCompound _ _ n) = n
annotation (CIf _ _ _ n) = n
annotation (CSwitch _ _ n) = n
annotation (CWhile _ _ _ n) = n
annotation (CFor _ _ _ _ n) = n
annotation (CGoto _ n) = n
annotation (CGotoPtr _ n) = n
annotation (CCont n) = n
annotation (CBreak n) = n
annotation (CReturn _ n) = n
annotation (CAsm _ n) = n
amap f (CLabel a_1 a_2 a_3 a_4) = CLabel a_1 a_2 a_3 (f a_4)
amap f (CCase a_1 a_2 a_3) = CCase a_1 a_2 (f a_3)
amap f (CCases a_1 a_2 a_3 a_4) = CCases a_1 a_2 a_3 (f a_4)
amap f (CDefault a_1 a_2) = CDefault a_1 (f a_2)
amap f (CExpr a_1 a_2) = CExpr a_1 (f a_2)
amap f (CCompound a_1 a_2 a_3) = CCompound a_1 a_2 (f a_3)
amap f (CIf a_1 a_2 a_3 a_4) = CIf a_1 a_2 a_3 (f a_4)
amap f (CSwitch a_1 a_2 a_3) = CSwitch a_1 a_2 (f a_3)
amap f (CWhile a_1 a_2 a_3 a_4) = CWhile a_1 a_2 a_3 (f a_4)
amap f (CFor a_1 a_2 a_3 a_4 a_5) = CFor a_1 a_2 a_3 a_4 (f a_5)
amap f (CGoto a_1 a_2) = CGoto a_1 (f a_2)
amap f (CGotoPtr a_1 a_2) = CGotoPtr a_1 (f a_2)
amap f (CCont a_1) = CCont (f a_1)
amap f (CBreak a_1) = CBreak (f a_1)
amap f (CReturn a_1 a_2) = CReturn a_1 (f a_2)
amap f (CAsm a_1 a_2) = CAsm a_1 (f a_2)
instance (CNode t1) => CNode (CAssemblyStatement t1) where
nodeInfo (CAsmStmt _ _ _ _ _ n) = nodeInfo n
instance (CNode t1) => Pos (CAssemblyStatement t1) where
posOf x = posOf (nodeInfo x)
instance Functor CAssemblyStatement where
fmap _f (CAsmStmt a1 a2 a3 a4 a5 a6)
= CAsmStmt (fmap (fmap _f) a1) (fmap _f a2) (fmap (fmap _f) a3)
(fmap (fmap _f) a4)
(fmap (fmap _f) a5)
(_f a6)
instance Annotated CAssemblyStatement where
annotation (CAsmStmt _ _ _ _ _ n) = n
amap f (CAsmStmt a_1 a_2 a_3 a_4 a_5 a_6)
= CAsmStmt a_1 a_2 a_3 a_4 a_5 (f a_6)
instance (CNode t1) => CNode (CAssemblyOperand t1) where
nodeInfo (CAsmOperand _ _ _ n) = nodeInfo n
instance (CNode t1) => Pos (CAssemblyOperand t1) where
posOf x = posOf (nodeInfo x)
instance Functor CAssemblyOperand where
fmap _f (CAsmOperand a1 a2 a3 a4)
= CAsmOperand a1 (fmap _f a2) (fmap _f a3) (_f a4)
instance Annotated CAssemblyOperand where
annotation (CAsmOperand _ _ _ n) = n
amap f (CAsmOperand a_1 a_2 a_3 a_4)
= CAsmOperand a_1 a_2 a_3 (f a_4)
instance (CNode t1) => CNode (CCompoundBlockItem t1) where
nodeInfo (CBlockStmt d) = nodeInfo d
nodeInfo (CBlockDecl d) = nodeInfo d
nodeInfo (CNestedFunDef d) = nodeInfo d
instance (CNode t1) => Pos (CCompoundBlockItem t1) where
posOf x = posOf (nodeInfo x)
instance Functor CCompoundBlockItem where
fmap _f (CBlockStmt a1) = CBlockStmt (fmap _f a1)
fmap _f (CBlockDecl a1) = CBlockDecl (fmap _f a1)
fmap _f (CNestedFunDef a1) = CNestedFunDef (fmap _f a1)
instance Annotated CCompoundBlockItem where
annotation (CBlockStmt n) = annotation n
annotation (CBlockDecl n) = annotation n
annotation (CNestedFunDef n) = annotation n
amap f (CBlockStmt n) = CBlockStmt (amap f n)
amap f (CBlockDecl n) = CBlockDecl (amap f n)
amap f (CNestedFunDef n) = CNestedFunDef (amap f n)
instance (CNode t1) => CNode (CDeclarationSpecifier t1) where
nodeInfo (CStorageSpec d) = nodeInfo d
nodeInfo (CTypeSpec d) = nodeInfo d
nodeInfo (CTypeQual d) = nodeInfo d
instance (CNode t1) => Pos (CDeclarationSpecifier t1) where
posOf x = posOf (nodeInfo x)
instance Functor CDeclarationSpecifier where
fmap _f (CStorageSpec a1) = CStorageSpec (fmap _f a1)
fmap _f (CTypeSpec a1) = CTypeSpec (fmap _f a1)
fmap _f (CTypeQual a1) = CTypeQual (fmap _f a1)
instance Annotated CDeclarationSpecifier where
annotation (CStorageSpec n) = annotation n
annotation (CTypeSpec n) = annotation n
annotation (CTypeQual n) = annotation n
amap f (CStorageSpec n) = CStorageSpec (amap f n)
amap f (CTypeSpec n) = CTypeSpec (amap f n)
amap f (CTypeQual n) = CTypeQual (amap f n)
instance (CNode t1) => CNode (CStorageSpecifier t1) where
nodeInfo (CAuto d) = nodeInfo d
nodeInfo (CRegister d) = nodeInfo d
nodeInfo (CStatic d) = nodeInfo d
nodeInfo (CExtern d) = nodeInfo d
nodeInfo (CTypedef d) = nodeInfo d
nodeInfo (CThread d) = nodeInfo d
instance (CNode t1) => Pos (CStorageSpecifier t1) where
posOf x = posOf (nodeInfo x)
instance Functor CStorageSpecifier where
fmap _f (CAuto a1) = CAuto (_f a1)
fmap _f (CRegister a1) = CRegister (_f a1)
fmap _f (CStatic a1) = CStatic (_f a1)
fmap _f (CExtern a1) = CExtern (_f a1)
fmap _f (CTypedef a1) = CTypedef (_f a1)
fmap _f (CThread a1) = CThread (_f a1)
instance Annotated CStorageSpecifier where
annotation (CAuto n) = n
annotation (CRegister n) = n
annotation (CStatic n) = n
annotation (CExtern n) = n
annotation (CTypedef n) = n
annotation (CThread n) = n
amap f (CAuto a_1) = CAuto (f a_1)
amap f (CRegister a_1) = CRegister (f a_1)
amap f (CStatic a_1) = CStatic (f a_1)
amap f (CExtern a_1) = CExtern (f a_1)
amap f (CTypedef a_1) = CTypedef (f a_1)
amap f (CThread a_1) = CThread (f a_1)
instance (CNode t1) => CNode (CTypeSpecifier t1) where
nodeInfo (CVoidType d) = nodeInfo d
nodeInfo (CCharType d) = nodeInfo d
nodeInfo (CShortType d) = nodeInfo d
nodeInfo (CIntType d) = nodeInfo d
nodeInfo (CLongType d) = nodeInfo d
nodeInfo (CFloatType d) = nodeInfo d
nodeInfo (CDoubleType d) = nodeInfo d
nodeInfo (CSignedType d) = nodeInfo d
nodeInfo (CUnsigType d) = nodeInfo d
nodeInfo (CBoolType d) = nodeInfo d
nodeInfo (CComplexType d) = nodeInfo d
nodeInfo (CSUType _ n) = nodeInfo n
nodeInfo (CEnumType _ n) = nodeInfo n
nodeInfo (CTypeDef _ n) = nodeInfo n
nodeInfo (CTypeOfExpr _ n) = nodeInfo n
nodeInfo (CTypeOfType _ n) = nodeInfo n
nodeInfo (ObjCClassProto _ _ n) = nodeInfo n
nodeInfo (ObjCTypeProto _ _ n) = nodeInfo n
instance (CNode t1) => Pos (CTypeSpecifier t1) where
posOf x = posOf (nodeInfo x)
instance Functor CTypeSpecifier where
fmap _f (CVoidType a1) = CVoidType (_f a1)
fmap _f (CCharType a1) = CCharType (_f a1)
fmap _f (CShortType a1) = CShortType (_f a1)
fmap _f (CIntType a1) = CIntType (_f a1)
fmap _f (CLongType a1) = CLongType (_f a1)
fmap _f (CFloatType a1) = CFloatType (_f a1)
fmap _f (CDoubleType a1) = CDoubleType (_f a1)
fmap _f (CSignedType a1) = CSignedType (_f a1)
fmap _f (CUnsigType a1) = CUnsigType (_f a1)
fmap _f (CBoolType a1) = CBoolType (_f a1)
fmap _f (CComplexType a1) = CComplexType (_f a1)
fmap _f (CSUType a1 a2) = CSUType (fmap _f a1) (_f a2)
fmap _f (CEnumType a1 a2) = CEnumType (fmap _f a1) (_f a2)
fmap _f (CTypeDef a1 a2) = CTypeDef a1 (_f a2)
fmap _f (CTypeOfExpr a1 a2) = CTypeOfExpr (fmap _f a1) (_f a2)
fmap _f (CTypeOfType a1 a2) = CTypeOfType (fmap _f a1) (_f a2)
fmap _f (ObjCClassProto a1 a2 a3)
= ObjCClassProto a1 (fmap (fmap _f) a2) (_f a3)
fmap _f (ObjCTypeProto a1 a2 a3)
= ObjCTypeProto a1 (fmap (fmap _f) a2) (_f a3)
instance Annotated CTypeSpecifier where
annotation (CVoidType n) = n
annotation (CCharType n) = n
annotation (CShortType n) = n
annotation (CIntType n) = n
annotation (CLongType n) = n
annotation (CFloatType n) = n
annotation (CDoubleType n) = n
annotation (CSignedType n) = n
annotation (CUnsigType n) = n
annotation (CBoolType n) = n
annotation (CComplexType n) = n
annotation (CSUType _ n) = n
annotation (CEnumType _ n) = n
annotation (CTypeDef _ n) = n
annotation (CTypeOfExpr _ n) = n
annotation (CTypeOfType _ n) = n
annotation (ObjCClassProto _ _ n) = n
annotation (ObjCTypeProto _ _ n) = n
amap f (CVoidType a_1) = CVoidType (f a_1)
amap f (CCharType a_1) = CCharType (f a_1)
amap f (CShortType a_1) = CShortType (f a_1)
amap f (CIntType a_1) = CIntType (f a_1)
amap f (CLongType a_1) = CLongType (f a_1)
amap f (CFloatType a_1) = CFloatType (f a_1)
amap f (CDoubleType a_1) = CDoubleType (f a_1)
amap f (CSignedType a_1) = CSignedType (f a_1)
amap f (CUnsigType a_1) = CUnsigType (f a_1)
amap f (CBoolType a_1) = CBoolType (f a_1)
amap f (CComplexType a_1) = CComplexType (f a_1)
amap f (CSUType a_1 a_2) = CSUType a_1 (f a_2)
amap f (CEnumType a_1 a_2) = CEnumType a_1 (f a_2)
amap f (CTypeDef a_1 a_2) = CTypeDef a_1 (f a_2)
amap f (CTypeOfExpr a_1 a_2) = CTypeOfExpr a_1 (f a_2)
amap f (CTypeOfType a_1 a_2) = CTypeOfType a_1 (f a_2)
amap f (ObjCClassProto a_1 a_2 a_3)
= ObjCClassProto a_1 a_2 (f a_3)
amap f (ObjCTypeProto a_1 a_2 a_3) = ObjCTypeProto a_1 a_2 (f a_3)
instance (CNode t1) => CNode (CTypeQualifier t1) where
nodeInfo (CConstQual d) = nodeInfo d
nodeInfo (CVolatQual d) = nodeInfo d
nodeInfo (CRestrQual d) = nodeInfo d
nodeInfo (CInlineQual d) = nodeInfo d
nodeInfo (CAttrQual d) = nodeInfo d
nodeInfo (ObjCProtoQual d) = nodeInfo d
instance (CNode t1) => Pos (CTypeQualifier t1) where
posOf x = posOf (nodeInfo x)
instance Functor CTypeQualifier where
fmap _f (CConstQual a1) = CConstQual (_f a1)
fmap _f (CVolatQual a1) = CVolatQual (_f a1)
fmap _f (CRestrQual a1) = CRestrQual (_f a1)
fmap _f (CInlineQual a1) = CInlineQual (_f a1)
fmap _f (CAttrQual a1) = CAttrQual (fmap _f a1)
fmap _f (ObjCProtoQual a1) = ObjCProtoQual (fmap _f a1)
instance Annotated CTypeQualifier where
annotation (CConstQual n) = n
annotation (CVolatQual n) = n
annotation (CRestrQual n) = n
annotation (CInlineQual n) = n
annotation (CAttrQual n) = annotation n
annotation (ObjCProtoQual n) = annotation n
amap f (CConstQual a_1) = CConstQual (f a_1)
amap f (CVolatQual a_1) = CVolatQual (f a_1)
amap f (CRestrQual a_1) = CRestrQual (f a_1)
amap f (CInlineQual a_1) = CInlineQual (f a_1)
amap f (CAttrQual n) = CAttrQual (amap f n)
amap f (ObjCProtoQual n) = ObjCProtoQual (amap f n)
instance (CNode t1) => CNode (ObjCProtoQualifier t1) where
nodeInfo (ObjCInQual d) = nodeInfo d
nodeInfo (ObjCOutQual d) = nodeInfo d
nodeInfo (ObjCInOutQual d) = nodeInfo d
nodeInfo (ObjCBycopyQual d) = nodeInfo d
nodeInfo (ObjCOnewayQual d) = nodeInfo d
instance (CNode t1) => Pos (ObjCProtoQualifier t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCProtoQualifier where
annotation (ObjCInQual n) = n
annotation (ObjCOutQual n) = n
annotation (ObjCInOutQual n) = n
annotation (ObjCBycopyQual n) = n
annotation (ObjCOnewayQual n) = n
amap f (ObjCInQual a_1) = ObjCInQual (f a_1)
amap f (ObjCOutQual a_1) = ObjCOutQual (f a_1)
amap f (ObjCInOutQual a_1) = ObjCInOutQual (f a_1)
amap f (ObjCBycopyQual a_1) = ObjCBycopyQual (f a_1)
amap f (ObjCOnewayQual a_1) = ObjCOnewayQual (f a_1)
instance (CNode t1) => CNode (CStructureUnion t1) where
nodeInfo (CStruct _ _ _ _ n) = nodeInfo n
instance (CNode t1) => Pos (CStructureUnion t1) where
posOf x = posOf (nodeInfo x)
instance Functor CStructureUnion where
fmap _f (CStruct a1 a2 a3 a4 a5)
= CStruct a1 a2 (fmap (fmap (fmap _f)) a3) (fmap (fmap _f) a4)
(_f a5)
instance Annotated CStructureUnion where
annotation (CStruct _ _ _ _ n) = n
amap f (CStruct a_1 a_2 a_3 a_4 a_5)
= CStruct a_1 a_2 a_3 a_4 (f a_5)
instance (CNode t1) => CNode (CEnumeration t1) where
nodeInfo (CEnum _ _ _ n) = nodeInfo n
instance (CNode t1) => Pos (CEnumeration t1) where
posOf x = posOf (nodeInfo x)
instance Functor CEnumeration where
fmap _f (CEnum a1 a2 a3 a4)
= CEnum a1 (fmap (fmap (fmap (fmap (fmap _f)))) a2)
(fmap (fmap _f) a3)
(_f a4)
instance Annotated CEnumeration where
annotation (CEnum _ _ _ n) = n
amap f (CEnum a_1 a_2 a_3 a_4) = CEnum a_1 a_2 a_3 (f a_4)
instance (CNode t1) => CNode (CInitializer t1) where
nodeInfo (CInitExpr _ n) = nodeInfo n
nodeInfo (CInitList _ n) = nodeInfo n
instance (CNode t1) => Pos (CInitializer t1) where
posOf x = posOf (nodeInfo x)
instance Annotated CInitializer where
annotation (CInitExpr _ n) = n
annotation (CInitList _ n) = n
amap f (CInitExpr a_1 a_2) = CInitExpr a_1 (f a_2)
amap f (CInitList a_1 a_2) = CInitList a_1 (f a_2)
instance (CNode t1) => CNode (CPartDesignator t1) where
nodeInfo (CArrDesig _ n) = nodeInfo n
nodeInfo (CMemberDesig _ n) = nodeInfo n
nodeInfo (CRangeDesig _ _ n) = nodeInfo n
instance (CNode t1) => Pos (CPartDesignator t1) where
posOf x = posOf (nodeInfo x)
instance Functor CPartDesignator where
fmap _f (CArrDesig a1 a2) = CArrDesig (fmap _f a1) (_f a2)
fmap _f (CMemberDesig a1 a2) = CMemberDesig a1 (_f a2)
fmap _f (CRangeDesig a1 a2 a3)
= CRangeDesig (fmap _f a1) (fmap _f a2) (_f a3)
instance Annotated CPartDesignator where
annotation (CArrDesig _ n) = n
annotation (CMemberDesig _ n) = n
annotation (CRangeDesig _ _ n) = n
amap f (CArrDesig a_1 a_2) = CArrDesig a_1 (f a_2)
amap f (CMemberDesig a_1 a_2) = CMemberDesig a_1 (f a_2)
amap f (CRangeDesig a_1 a_2 a_3) = CRangeDesig a_1 a_2 (f a_3)
instance (CNode t1) => CNode (CAttribute t1) where
nodeInfo (CAttr _ _ n) = nodeInfo n
instance (CNode t1) => Pos (CAttribute t1) where
posOf x = posOf (nodeInfo x)
instance Functor CAttribute where
fmap _f (CAttr a1 a2 a3) = CAttr a1 (fmap (fmap _f) a2) (_f a3)
instance Annotated CAttribute where
annotation (CAttr _ _ n) = n
amap f (CAttr a_1 a_2 a_3) = CAttr a_1 a_2 (f a_3)
instance (CNode t1) => CNode (CExpression t1) where
nodeInfo (CComma _ n) = nodeInfo n
nodeInfo (CAssign _ _ _ n) = nodeInfo n
nodeInfo (CCond _ _ _ n) = nodeInfo n
nodeInfo (CBinary _ _ _ n) = nodeInfo n
nodeInfo (CCast _ _ n) = nodeInfo n
nodeInfo (CUnary _ _ n) = nodeInfo n
nodeInfo (CSizeofExpr _ n) = nodeInfo n
nodeInfo (CSizeofType _ n) = nodeInfo n
nodeInfo (CAlignofExpr _ n) = nodeInfo n
nodeInfo (CAlignofType _ n) = nodeInfo n
nodeInfo (CComplexReal _ n) = nodeInfo n
nodeInfo (CComplexImag _ n) = nodeInfo n
nodeInfo (CIndex _ _ n) = nodeInfo n
nodeInfo (CCall _ _ n) = nodeInfo n
nodeInfo (CMember _ _ _ n) = nodeInfo n
nodeInfo (CVar _ n) = nodeInfo n
nodeInfo (CConst d) = nodeInfo d
nodeInfo (CCompoundLit _ _ n) = nodeInfo n
nodeInfo (CStatExpr _ n) = nodeInfo n
nodeInfo (CLabAddrExpr _ n) = nodeInfo n
nodeInfo (CBuiltinExpr d) = nodeInfo d
nodeInfo (CBlockExpr _ _ n) = nodeInfo n
nodeInfo (ObjCMessageExpr _ n) = nodeInfo n
nodeInfo (ObjCSelectorExpr _ n) = nodeInfo n
nodeInfo (ObjCProtoExpr _ n) = nodeInfo n
nodeInfo (ObjCEncodeExpr _ n) = nodeInfo n
nodeInfo (ObjCConst d) = nodeInfo d
instance (CNode t1) => Pos (CExpression t1) where
posOf x = posOf (nodeInfo x)
instance Annotated CExpression where
annotation (CComma _ n) = n
annotation (CAssign _ _ _ n) = n
annotation (CCond _ _ _ n) = n
annotation (CBinary _ _ _ n) = n
annotation (CCast _ _ n) = n
annotation (CUnary _ _ n) = n
annotation (CSizeofExpr _ n) = n
annotation (CSizeofType _ n) = n
annotation (CAlignofExpr _ n) = n
annotation (CAlignofType _ n) = n
annotation (CComplexReal _ n) = n
annotation (CComplexImag _ n) = n
annotation (CIndex _ _ n) = n
annotation (CCall _ _ n) = n
annotation (CMember _ _ _ n) = n
annotation (CVar _ n) = n
annotation (CConst n) = annotation n
annotation (CCompoundLit _ _ n) = n
annotation (CStatExpr _ n) = n
annotation (CLabAddrExpr _ n) = n
annotation (CBuiltinExpr n) = annotation n
annotation (CBlockExpr _ _ n) = n
annotation (ObjCMessageExpr _ n) = n
annotation (ObjCSelectorExpr _ n) = n
annotation (ObjCProtoExpr _ n) = n
annotation (ObjCEncodeExpr _ n) = n
annotation (ObjCConst n) = annotation n
amap f (CComma a_1 a_2) = CComma a_1 (f a_2)
amap f (CAssign a_1 a_2 a_3 a_4) = CAssign a_1 a_2 a_3 (f a_4)
amap f (CCond a_1 a_2 a_3 a_4) = CCond a_1 a_2 a_3 (f a_4)
amap f (CBinary a_1 a_2 a_3 a_4) = CBinary a_1 a_2 a_3 (f a_4)
amap f (CCast a_1 a_2 a_3) = CCast a_1 a_2 (f a_3)
amap f (CUnary a_1 a_2 a_3) = CUnary a_1 a_2 (f a_3)
amap f (CSizeofExpr a_1 a_2) = CSizeofExpr a_1 (f a_2)
amap f (CSizeofType a_1 a_2) = CSizeofType a_1 (f a_2)
amap f (CAlignofExpr a_1 a_2) = CAlignofExpr a_1 (f a_2)
amap f (CAlignofType a_1 a_2) = CAlignofType a_1 (f a_2)
amap f (CComplexReal a_1 a_2) = CComplexReal a_1 (f a_2)
amap f (CComplexImag a_1 a_2) = CComplexImag a_1 (f a_2)
amap f (CIndex a_1 a_2 a_3) = CIndex a_1 a_2 (f a_3)
amap f (CCall a_1 a_2 a_3) = CCall a_1 a_2 (f a_3)
amap f (CMember a_1 a_2 a_3 a_4) = CMember a_1 a_2 a_3 (f a_4)
amap f (CVar a_1 a_2) = CVar a_1 (f a_2)
amap f (CConst n) = CConst (amap f n)
amap f (CCompoundLit a_1 a_2 a_3) = CCompoundLit a_1 a_2 (f a_3)
amap f (CStatExpr a_1 a_2) = CStatExpr a_1 (f a_2)
amap f (CLabAddrExpr a_1 a_2) = CLabAddrExpr a_1 (f a_2)
amap f (CBuiltinExpr n) = CBuiltinExpr (amap f n)
amap f (CBlockExpr a_1 a_2 a_3) = CBlockExpr a_1 a_2 (f a_3)
amap f (ObjCMessageExpr a_1 a_2) = ObjCMessageExpr a_1 (f a_2)
amap f (ObjCSelectorExpr a_1 a_2) = ObjCSelectorExpr a_1 (f a_2)
amap f (ObjCProtoExpr a_1 a_2) = ObjCProtoExpr a_1 (f a_2)
amap f (ObjCEncodeExpr a_1 a_2) = ObjCEncodeExpr a_1 (f a_2)
amap f (ObjCConst n) = ObjCConst (amap f n)
instance (CNode t1) => CNode (ObjCSelectorName t1) where
nodeInfo (ObjCSelPlain _ n) = nodeInfo n
nodeInfo (ObjCSelKeys _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCSelectorName t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCSelectorName where
annotation (ObjCSelPlain _ n) = n
annotation (ObjCSelKeys _ n) = n
amap f (ObjCSelPlain a_1 a_2) = ObjCSelPlain a_1 (f a_2)
amap f (ObjCSelKeys a_1 a_2) = ObjCSelKeys a_1 (f a_2)
instance (CNode t1) => CNode (ObjCSelectorKeyName t1) where
nodeInfo (ObjCSelKeyName _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCSelectorKeyName t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCSelectorKeyName where
annotation (ObjCSelKeyName _ n) = n
amap f (ObjCSelKeyName a_1 a_2) = ObjCSelKeyName a_1 (f a_2)
instance (CNode t1) => CNode (ObjCSelector t1) where
nodeInfo (ObjCSel _ n) = nodeInfo n
nodeInfo (ObjCInSel d) = nodeInfo d
nodeInfo (ObjCOutSel d) = nodeInfo d
instance (CNode t1) => Pos (ObjCSelector t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCSelector where
annotation (ObjCSel _ n) = n
annotation (ObjCInSel n) = n
annotation (ObjCOutSel n) = n
amap f (ObjCSel a_1 a_2) = ObjCSel a_1 (f a_2)
amap f (ObjCInSel a_1) = ObjCInSel (f a_1)
amap f (ObjCOutSel a_1) = ObjCOutSel (f a_1)
instance (CNode t1) => CNode (ObjCMessageExpression t1) where
nodeInfo (ObjCMsgExpr _ _ n) = nodeInfo n
nodeInfo (ObjCMsgClass _ _ n) = nodeInfo n
nodeInfo (ObjCMsgSup _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCMessageExpression t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCMessageExpression where
annotation (ObjCMsgExpr _ _ n) = n
annotation (ObjCMsgClass _ _ n) = n
annotation (ObjCMsgSup _ n) = n
amap f (ObjCMsgExpr a_1 a_2 a_3) = ObjCMsgExpr a_1 a_2 (f a_3)
amap f (ObjCMsgClass a_1 a_2 a_3) = ObjCMsgClass a_1 a_2 (f a_3)
amap f (ObjCMsgSup a_1 a_2) = ObjCMsgSup a_1 (f a_2)
instance (CNode t1) => CNode (ObjCMessageSelector t1) where
nodeInfo (ObjCMsgSel _ n) = nodeInfo n
nodeInfo (ObjCKeyArgs _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCMessageSelector t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCMessageSelector where
annotation (ObjCMsgSel _ n) = n
annotation (ObjCKeyArgs _ n) = n
amap f (ObjCMsgSel a_1 a_2) = ObjCMsgSel a_1 (f a_2)
amap f (ObjCKeyArgs a_1 a_2) = ObjCKeyArgs a_1 (f a_2)
instance (CNode t1) => CNode (ObjCKeywordArg t1) where
nodeInfo (ObjCKeyArg _ _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCKeywordArg t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCKeywordArg where
annotation (ObjCKeyArg _ _ n) = n
amap f (ObjCKeyArg a_1 a_2 a_3) = ObjCKeyArg a_1 a_2 (f a_3)
instance (CNode t1) => CNode (CBuiltinThing t1) where
nodeInfo (CBuiltinVaArg _ _ n) = nodeInfo n
nodeInfo (CBuiltinOffsetOf _ _ n) = nodeInfo n
nodeInfo (CBuiltinTypesCompatible _ _ n) = nodeInfo n
instance (CNode t1) => Pos (CBuiltinThing t1) where
posOf x = posOf (nodeInfo x)
instance Functor CBuiltinThing where
fmap _f (CBuiltinVaArg a1 a2 a3)
= CBuiltinVaArg (fmap _f a1) (fmap _f a2) (_f a3)
fmap _f (CBuiltinOffsetOf a1 a2 a3)
= CBuiltinOffsetOf (fmap _f a1) (fmap (fmap _f) a2) (_f a3)
fmap _f (CBuiltinTypesCompatible a1 a2 a3)
= CBuiltinTypesCompatible (fmap _f a1) (fmap _f a2) (_f a3)
instance Annotated CBuiltinThing where
annotation (CBuiltinVaArg _ _ n) = n
annotation (CBuiltinOffsetOf _ _ n) = n
annotation (CBuiltinTypesCompatible _ _ n) = n
amap f (CBuiltinVaArg a_1 a_2 a_3) = CBuiltinVaArg a_1 a_2 (f a_3)
amap f (CBuiltinOffsetOf a_1 a_2 a_3)
= CBuiltinOffsetOf a_1 a_2 (f a_3)
amap f (CBuiltinTypesCompatible a_1 a_2 a_3)
= CBuiltinTypesCompatible a_1 a_2 (f a_3)
instance (CNode t1) => CNode (ObjCConstant t1) where
nodeInfo (ObjCStrConst _ n) = nodeInfo n
instance (CNode t1) => Pos (ObjCConstant t1) where
posOf x = posOf (nodeInfo x)
instance Annotated ObjCConstant where
annotation (ObjCStrConst _ n) = n
amap f (ObjCStrConst a_1 a_2) = ObjCStrConst a_1 (f a_2)
instance (CNode t1) => CNode (CConstant t1) where
nodeInfo (CIntConst _ n) = nodeInfo n
nodeInfo (CCharConst _ n) = nodeInfo n
nodeInfo (CFloatConst _ n) = nodeInfo n
nodeInfo (CStrConst _ n) = nodeInfo n
instance (CNode t1) => Pos (CConstant t1) where
posOf x = posOf (nodeInfo x)
instance Functor CConstant where
fmap _f (CIntConst a1 a2) = CIntConst a1 (_f a2)
fmap _f (CCharConst a1 a2) = CCharConst a1 (_f a2)
fmap _f (CFloatConst a1 a2) = CFloatConst a1 (_f a2)
fmap _f (CStrConst a1 a2) = CStrConst a1 (_f a2)
instance Annotated CConstant where
annotation (CIntConst _ n) = n
annotation (CCharConst _ n) = n
annotation (CFloatConst _ n) = n
annotation (CStrConst _ n) = n
amap f (CIntConst a_1 a_2) = CIntConst a_1 (f a_2)
amap f (CCharConst a_1 a_2) = CCharConst a_1 (f a_2)
amap f (CFloatConst a_1 a_2) = CFloatConst a_1 (f a_2)
amap f (CStrConst a_1 a_2) = CStrConst a_1 (f a_2)
instance (CNode t1) => CNode (CStringLiteral t1) where
nodeInfo (CStrLit _ n) = nodeInfo n
instance (CNode t1) => Pos (CStringLiteral t1) where
posOf x = posOf (nodeInfo x)
instance Functor CStringLiteral where
fmap _f (CStrLit a1 a2) = CStrLit a1 (_f a2)
instance Annotated CStringLiteral where
annotation (CStrLit _ n) = n
amap f (CStrLit a_1 a_2) = CStrLit a_1 (f a_2)