{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TypeSynonymInstances #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Language.C.Syntax.AST
-- Copyright   :  (c) [1999..2007] Manuel M T Chakravarty
--                (c) 2008 Benedikt Huber
-- License     :  BSD-style
-- Maintainer  : benedikt.huber@gmail.com
-- Stability   : experimental
-- Portability : ghc
--
-- Abstract syntax of C source and header files.
--
--  The tree structure is based on the grammar in Appendix A of K&R.  The
--  abstract syntax simplifies the concrete syntax by merging similar concrete
--  constructs into a single type of abstract tree structure: declarations are
--  merged with structure declarations, parameter declarations and type names,
--  and declarators are merged with abstract declarators.
--
--  With K&R we refer to ``The C Programming Language'', second edition, Brain
--  W. Kernighan and Dennis M. Ritchie, Prentice Hall, 1988. The AST supports all
--  of C99 <http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf> and several
--  GNU extensions <http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html>.
-----------------------------------------------------------------------------
module Language.C.Syntax.AST (
  -- * C translation units
  CTranslUnit,  CExtDecl,
  CTranslationUnit(..),  CExternalDeclaration(..),
  -- * Declarations
  CFunDef,  CDecl, CStructUnion, CEnum,
  CFunctionDef(..),  CDeclaration(..),
  CStructTag(..), CStructureUnion(..),  CEnumeration(..),
  -- * Declaration attributes
  CDeclSpec, partitionDeclSpecs,
  CStorageSpec, CTypeSpec, isSUEDef, CTypeQual, CFunSpec, CAlignSpec,  CAttr,
  CFunctionSpecifier(..), CDeclarationSpecifier(..), CStorageSpecifier(..), CTypeSpecifier(..),
  CAlignmentSpecifier(..),
  CTypeQualifier(..), CAttribute(..),
  -- * Declarators
  CDeclr,CDerivedDeclr,CArrSize,
  CDeclarator(..), CDerivedDeclarator(..), CArraySize(..),
  -- * Initialization
  CInit, CInitList, CDesignator,
  CInitializer(..), CInitializerList, CPartDesignator(..),
  -- * Statements
  CStat, CBlockItem, CAsmStmt, CAsmOperand,
  CStatement(..), CCompoundBlockItem(..),
  CAssemblyStatement(..), CAssemblyOperand(..),
  -- * Expressions
  CExpr, CExpression(..),
  CAssignOp(..), CBinaryOp(..), CUnaryOp(..),
  CBuiltin, CBuiltinThing(..),
  -- * Constants
  CConst, CStrLit, cstringOfLit, liftStrLit,
  CConstant(..), CStringLiteral(..),
  -- * Annoated type class
  Annotated(..)
) where
import Language.C.Syntax.Constants
import Language.C.Syntax.Ops
import Language.C.Data.Ident
import Language.C.Data.Node
import Language.C.Data.Position
import Data.Data (Data)
import Data.Typeable (Typeable)
import GHC.Generics (Generic, Generic1)
import Control.DeepSeq (NFData)

-- | Complete C tranlsation unit (C99 6.9, K&R A10)
--
-- A complete C translation unit, for example representing a C header or source file.
-- It consists of a list of external (i.e. toplevel) declarations.
type CTranslUnit = CTranslationUnit NodeInfo
data CTranslationUnit a
  = CTranslUnit [CExternalDeclaration a] a
    deriving (Int -> CTranslationUnit a -> ShowS
forall a. Show a => Int -> CTranslationUnit a -> ShowS
forall a. Show a => [CTranslationUnit a] -> ShowS
forall a. Show a => CTranslationUnit a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CTranslationUnit a] -> ShowS
$cshowList :: forall a. Show a => [CTranslationUnit a] -> ShowS
show :: CTranslationUnit a -> String
$cshow :: forall a. Show a => CTranslationUnit a -> String
showsPrec :: Int -> CTranslationUnit a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CTranslationUnit a -> ShowS
Show, CTranslationUnit a -> DataType
CTranslationUnit a -> Constr
forall {a}. Data a => Typeable (CTranslationUnit a)
forall a. Data a => CTranslationUnit a -> DataType
forall a. Data a => CTranslationUnit a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> CTranslationUnit a -> CTranslationUnit a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CTranslationUnit a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CTranslationUnit a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CTranslationUnit a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CTranslationUnit a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CTranslationUnit a -> m (CTranslationUnit a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CTranslationUnit a -> m (CTranslationUnit a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CTranslationUnit a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CTranslationUnit a
-> c (CTranslationUnit a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CTranslationUnit a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CTranslationUnit a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CTranslationUnit a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CTranslationUnit a
-> c (CTranslationUnit a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CTranslationUnit a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CTranslationUnit a -> m (CTranslationUnit a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CTranslationUnit a -> m (CTranslationUnit a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CTranslationUnit a -> m (CTranslationUnit a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CTranslationUnit a -> m (CTranslationUnit a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CTranslationUnit a -> m (CTranslationUnit a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CTranslationUnit a -> m (CTranslationUnit a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CTranslationUnit a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CTranslationUnit a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CTranslationUnit a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CTranslationUnit a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CTranslationUnit a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CTranslationUnit a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CTranslationUnit a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CTranslationUnit a -> r
gmapT :: (forall b. Data b => b -> b)
-> CTranslationUnit a -> CTranslationUnit a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> CTranslationUnit a -> CTranslationUnit a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CTranslationUnit a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CTranslationUnit a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CTranslationUnit a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CTranslationUnit a))
dataTypeOf :: CTranslationUnit a -> DataType
$cdataTypeOf :: forall a. Data a => CTranslationUnit a -> DataType
toConstr :: CTranslationUnit a -> Constr
$ctoConstr :: forall a. Data a => CTranslationUnit a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CTranslationUnit a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CTranslationUnit a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CTranslationUnit a
-> c (CTranslationUnit a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CTranslationUnit a
-> c (CTranslationUnit a)
Data, Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CTranslationUnit a) x -> CTranslationUnit a
forall a x. CTranslationUnit a -> Rep (CTranslationUnit a) x
$cto :: forall a x. Rep (CTranslationUnit a) x -> CTranslationUnit a
$cfrom :: forall a x. CTranslationUnit a -> Rep (CTranslationUnit a) x
Generic, forall a. Rep1 CTranslationUnit a -> CTranslationUnit a
forall a. CTranslationUnit a -> Rep1 CTranslationUnit a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CTranslationUnit a -> CTranslationUnit a
$cfrom1 :: forall a. CTranslationUnit a -> Rep1 CTranslationUnit a
Generic1 {-! ,CNode ,Functor, Annotated !-})

instance NFData a => NFData (CTranslationUnit a)

-- | External C declaration (C99 6.9, K&R A10)
--
-- Either a toplevel declaration, function definition or external assembler.
type CExtDecl = CExternalDeclaration NodeInfo
data CExternalDeclaration a
  = CDeclExt (CDeclaration a)
  | CFDefExt (CFunctionDef a)
  | CAsmExt  (CStringLiteral a) a
    deriving (Int -> CExternalDeclaration a -> ShowS
forall a. Show a => Int -> CExternalDeclaration a -> ShowS
forall a. Show a => [CExternalDeclaration a] -> ShowS
forall a. Show a => CExternalDeclaration a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CExternalDeclaration a] -> ShowS
$cshowList :: forall a. Show a => [CExternalDeclaration a] -> ShowS
show :: CExternalDeclaration a -> String
$cshow :: forall a. Show a => CExternalDeclaration a -> String
showsPrec :: Int -> CExternalDeclaration a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CExternalDeclaration a -> ShowS
Show, CExternalDeclaration a -> DataType
CExternalDeclaration a -> Constr
forall {a}. Data a => Typeable (CExternalDeclaration a)
forall a. Data a => CExternalDeclaration a -> DataType
forall a. Data a => CExternalDeclaration a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> CExternalDeclaration a -> CExternalDeclaration a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CExternalDeclaration a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CExternalDeclaration a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> CExternalDeclaration a
-> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> CExternalDeclaration a
-> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CExternalDeclaration a -> m (CExternalDeclaration a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CExternalDeclaration a -> m (CExternalDeclaration a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CExternalDeclaration a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CExternalDeclaration a
-> c (CExternalDeclaration a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CExternalDeclaration a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CExternalDeclaration a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CExternalDeclaration a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CExternalDeclaration a
-> c (CExternalDeclaration a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CExternalDeclaration a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CExternalDeclaration a -> m (CExternalDeclaration a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CExternalDeclaration a -> m (CExternalDeclaration a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CExternalDeclaration a -> m (CExternalDeclaration a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CExternalDeclaration a -> m (CExternalDeclaration a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CExternalDeclaration a -> m (CExternalDeclaration a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CExternalDeclaration a -> m (CExternalDeclaration a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CExternalDeclaration a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CExternalDeclaration a -> u
gmapQ :: forall u.
(forall d. Data d => d -> u) -> CExternalDeclaration a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CExternalDeclaration a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> CExternalDeclaration a
-> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> CExternalDeclaration a
-> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> CExternalDeclaration a
-> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> CExternalDeclaration a
-> r
gmapT :: (forall b. Data b => b -> b)
-> CExternalDeclaration a -> CExternalDeclaration a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> CExternalDeclaration a -> CExternalDeclaration a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CExternalDeclaration a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CExternalDeclaration a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CExternalDeclaration a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CExternalDeclaration a))
dataTypeOf :: CExternalDeclaration a -> DataType
$cdataTypeOf :: forall a. Data a => CExternalDeclaration a -> DataType
toConstr :: CExternalDeclaration a -> Constr
$ctoConstr :: forall a. Data a => CExternalDeclaration a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CExternalDeclaration a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CExternalDeclaration a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CExternalDeclaration a
-> c (CExternalDeclaration a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CExternalDeclaration a
-> c (CExternalDeclaration a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x.
Rep (CExternalDeclaration a) x -> CExternalDeclaration a
forall a x.
CExternalDeclaration a -> Rep (CExternalDeclaration a) x
$cto :: forall a x.
Rep (CExternalDeclaration a) x -> CExternalDeclaration a
$cfrom :: forall a x.
CExternalDeclaration a -> Rep (CExternalDeclaration a) x
Generic, forall a. Rep1 CExternalDeclaration a -> CExternalDeclaration a
forall a. CExternalDeclaration a -> Rep1 CExternalDeclaration a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CExternalDeclaration a -> CExternalDeclaration a
$cfrom1 :: forall a. CExternalDeclaration a -> Rep1 CExternalDeclaration a
Generic1 {-! ,CNode ,Functor, Annotated !-})

instance NFData a => NFData (CExternalDeclaration a)

-- | C function definition (C99 6.9.1, K&R A10.1)
--
-- A function definition is of the form @CFunDef specifiers declarator decllist? stmt@.
--
-- * @specifiers@ are the type and storage-class specifiers of the function.
--   The only storage-class specifiers allowed are /extern/ and /static/.
--
-- * The @declarator@ must be such that the declared identifier has /function type/.
--   The return type shall be void or an object type other than array type.
--
-- * The optional declaration list @decllist@ is for old-style function declarations.
--
-- * The statement @stmt@ is a compound statement.
type CFunDef = CFunctionDef NodeInfo
data CFunctionDef a
  = CFunDef
    [CDeclarationSpecifier a] -- type specifier and qualifier
    (CDeclarator a)           -- declarator
    [CDeclaration a]          -- optional declaration list
    (CStatement a)            -- compound statement
    a
    deriving (Int -> CFunctionDef a -> ShowS
forall a. Show a => Int -> CFunctionDef a -> ShowS
forall a. Show a => [CFunctionDef a] -> ShowS
forall a. Show a => CFunctionDef a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CFunctionDef a] -> ShowS
$cshowList :: forall a. Show a => [CFunctionDef a] -> ShowS
show :: CFunctionDef a -> String
$cshow :: forall a. Show a => CFunctionDef a -> String
showsPrec :: Int -> CFunctionDef a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CFunctionDef a -> ShowS
Show, CFunctionDef a -> DataType
CFunctionDef a -> Constr
forall {a}. Data a => Typeable (CFunctionDef a)
forall a. Data a => CFunctionDef a -> DataType
forall a. Data a => CFunctionDef a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> CFunctionDef a -> CFunctionDef a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CFunctionDef a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CFunctionDef a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CFunctionDef a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CFunctionDef a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CFunctionDef a -> m (CFunctionDef a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CFunctionDef a -> m (CFunctionDef a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CFunctionDef a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CFunctionDef a -> c (CFunctionDef a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CFunctionDef a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CFunctionDef a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CFunctionDef a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CFunctionDef a -> c (CFunctionDef a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CFunctionDef a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CFunctionDef a -> m (CFunctionDef a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CFunctionDef a -> m (CFunctionDef a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CFunctionDef a -> m (CFunctionDef a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CFunctionDef a -> m (CFunctionDef a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CFunctionDef a -> m (CFunctionDef a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CFunctionDef a -> m (CFunctionDef a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CFunctionDef a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CFunctionDef a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CFunctionDef a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CFunctionDef a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CFunctionDef a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CFunctionDef a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CFunctionDef a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CFunctionDef a -> r
gmapT :: (forall b. Data b => b -> b) -> CFunctionDef a -> CFunctionDef a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> CFunctionDef a -> CFunctionDef a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CFunctionDef a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CFunctionDef a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CFunctionDef a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CFunctionDef a))
dataTypeOf :: CFunctionDef a -> DataType
$cdataTypeOf :: forall a. Data a => CFunctionDef a -> DataType
toConstr :: CFunctionDef a -> Constr
$ctoConstr :: forall a. Data a => CFunctionDef a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CFunctionDef a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CFunctionDef a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CFunctionDef a -> c (CFunctionDef a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CFunctionDef a -> c (CFunctionDef a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CFunctionDef a) x -> CFunctionDef a
forall a x. CFunctionDef a -> Rep (CFunctionDef a) x
$cto :: forall a x. Rep (CFunctionDef a) x -> CFunctionDef a
$cfrom :: forall a x. CFunctionDef a -> Rep (CFunctionDef a) x
Generic, forall a. Rep1 CFunctionDef a -> CFunctionDef a
forall a. CFunctionDef a -> Rep1 CFunctionDef a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CFunctionDef a -> CFunctionDef a
$cfrom1 :: forall a. CFunctionDef a -> Rep1 CFunctionDef a
Generic1 {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CFunctionDef a)

-- | C declarations (K&R A8, C99 6.7), including structure declarations, parameter
--   declarations and type names.
--
-- A declaration is of the form @CDecl specifiers init-declarator-list@, where the form of the declarator list's
--  elements depends on the kind of declaration:
--
-- 1) Toplevel declarations (K&R A8, C99 6.7 declaration)
--
--   * C99 requires that there is at least one specifier, though this is merely a syntactic restriction
--
--   * at most one storage class specifier is allowed per declaration
--
--   * the elements of the non-empty @init-declarator-list@ are of the form @(Just declr, init?, Nothing)@.
--      The declarator @declr@ has to be present and non-abstract and the initialization expression is
--      optional.
--
-- 2) Structure declarations (K&R A8.3, C99 6.7.2.1 struct-declaration)
--
--   Those are the declarations of a structure's members.
--
--   * do not allow storage specifiers
--
--   * in strict C99, the list of declarators has to be non-empty
--
--   * the elements of @init-declarator-list@ are either of the form @(Just declr, Nothing, size?)@,
--     representing a member with optional bit-field size, or of the form @(Nothing, Nothing, Just size)@,
--     for unnamed bitfields. @declr@ has to be non-abstract.
--
--   * no member of a structure shall have incomplete type
--
-- 3) Parameter declarations (K&R A8.6.3, C99 6.7.5 parameter-declaration)
--
--   * @init-declarator-list@ must contain at most one triple of the form @(Just declr, Nothing, Nothing)@,
--     i.e. consist of a single declarator, which is allowed to be abstract (i.e. unnamed).
--
-- 4) Type names (A8.8, C99 6.7.6)
--
--   * do not allow storage specifiers
--
--   * @init-declarator-list@ must contain at most one triple of the form @(Just declr, Nothing, Nothing)@.
--     where @declr@ is an abstract declarator (i.e. doesn't contain a declared identifier)
--
type CDecl = CDeclaration NodeInfo
data CDeclaration a
  = CDecl
    [CDeclarationSpecifier a] -- type specifier and qualifier, __attribute__
    [(Maybe (CDeclarator a),  -- declarator (may be omitted)
      Maybe (CInitializer a), -- optional initialize
      Maybe (CExpression a))] -- optional size (const expr)
    a                         -- annotation
    | CStaticAssert
      (CExpression a)         -- assert expression
      (CStringLiteral a)      -- assert text
      a                       -- annotation
    deriving (Int -> CDeclaration a -> ShowS
forall a. Show a => Int -> CDeclaration a -> ShowS
forall a. Show a => [CDeclaration a] -> ShowS
forall a. Show a => CDeclaration a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CDeclaration a] -> ShowS
$cshowList :: forall a. Show a => [CDeclaration a] -> ShowS
show :: CDeclaration a -> String
$cshow :: forall a. Show a => CDeclaration a -> String
showsPrec :: Int -> CDeclaration a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CDeclaration a -> ShowS
Show, CDeclaration a -> DataType
CDeclaration a -> Constr
forall {a}. Data a => Typeable (CDeclaration a)
forall a. Data a => CDeclaration a -> DataType
forall a. Data a => CDeclaration a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> CDeclaration a -> CDeclaration a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CDeclaration a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CDeclaration a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CDeclaration a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CDeclaration a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CDeclaration a -> m (CDeclaration a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CDeclaration a -> m (CDeclaration a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDeclaration a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CDeclaration a -> c (CDeclaration a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CDeclaration a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CDeclaration a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDeclaration a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CDeclaration a -> c (CDeclaration a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CDeclaration a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CDeclaration a -> m (CDeclaration a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CDeclaration a -> m (CDeclaration a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CDeclaration a -> m (CDeclaration a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CDeclaration a -> m (CDeclaration a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CDeclaration a -> m (CDeclaration a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CDeclaration a -> m (CDeclaration a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CDeclaration a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CDeclaration a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CDeclaration a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CDeclaration a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CDeclaration a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CDeclaration a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CDeclaration a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CDeclaration a -> r
gmapT :: (forall b. Data b => b -> b) -> CDeclaration a -> CDeclaration a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> CDeclaration a -> CDeclaration a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CDeclaration a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CDeclaration a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CDeclaration a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CDeclaration a))
dataTypeOf :: CDeclaration a -> DataType
$cdataTypeOf :: forall a. Data a => CDeclaration a -> DataType
toConstr :: CDeclaration a -> Constr
$ctoConstr :: forall a. Data a => CDeclaration a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDeclaration a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDeclaration a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CDeclaration a -> c (CDeclaration a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CDeclaration a -> c (CDeclaration a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CDeclaration a) x -> CDeclaration a
forall a x. CDeclaration a -> Rep (CDeclaration a) x
$cto :: forall a x. Rep (CDeclaration a) x -> CDeclaration a
$cfrom :: forall a x. CDeclaration a -> Rep (CDeclaration a) x
Generic {-! ,CNode ,Annotated !-})

instance NFData a => NFData (CDeclaration a)

-- Derive instance is a little bit ugly
instance Functor CDeclaration where
  fmap :: forall a b. (a -> b) -> CDeclaration a -> CDeclaration b
fmap a -> b
f (CDecl [CDeclarationSpecifier a]
specs [(Maybe (CDeclarator a), Maybe (CInitializer a),
  Maybe (CExpression a))]
declarators a
annot) =
    forall a.
[CDeclarationSpecifier a]
-> [(Maybe (CDeclarator a), Maybe (CInitializer a),
     Maybe (CExpression a))]
-> a
-> CDeclaration a
CDecl (forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f) [CDeclarationSpecifier a]
specs) (forall a b. (a -> b) -> [a] -> [b]
map forall {f :: * -> *} {f :: * -> *} {f :: * -> *} {f :: * -> *}
       {f :: * -> *} {f :: * -> *}.
(Functor f, Functor f, Functor f, Functor f, Functor f,
 Functor f) =>
(f (f a), f (f a), f (f a)) -> (f (f b), f (f b), f (f b))
fmap3m [(Maybe (CDeclarator a), Maybe (CInitializer a),
  Maybe (CExpression a))]
declarators) (a -> b
f a
annot)
      where fmap3m :: (f (f a), f (f a), f (f a)) -> (f (f b), f (f b), f (f b))
fmap3m (f (f a)
a,f (f a)
b,f (f a)
c) = (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f) f (f a)
a, forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f) f (f a)
b, forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f) f (f a)
c)
  fmap a -> b
f (CStaticAssert CExpression a
expression CStringLiteral a
strlit a
annot) =
    forall a. CExpression a -> CStringLiteral a -> a -> CDeclaration a
CStaticAssert (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f CExpression a
expression) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f CStringLiteral a
strlit) (a -> b
f a
annot)

-- | C declarator (K&R A8.5, C99 6.7.5) and abstract declarator (K&R A8.8, C99 6.7.6)
--
-- A declarator declares a single object, function, or type. It is always associated with
-- a declaration ('CDecl'), which specifies the declaration's type and the additional storage qualifiers and
-- attributes, which apply to the declared object.
--
-- A declarator is of the form @CDeclr name? indirections asm-name? attrs _@, where
-- @name@ is the name of the declared object (missing for abstract declarators),
-- @declquals@ is a set of additional declaration specifiers,
-- @asm-name@ is the optional assembler name and attributes is a set of
-- attrs is a set of @__attribute__@ annotations for the declared object.
--
-- @indirections@ is a set of pointer, array and function declarators, which modify the type of the declared object as
-- described below. If the /declaration/ specifies the non-derived type @T@,
-- and we have @indirections = [D1, D2, ..., Dn]@ than the declared object has type
-- @(D1 `indirect` (D2 `indirect` ...  (Dn `indirect` T)))@, where
--
--  * @(CPtrDeclr attrs) `indirect` T@ is /attributed pointer to T/
--
--  * @(CFunDeclr attrs) `indirect` T@ is /attributed function returning T/
--
--  * @(CArrayDeclr attrs) `indirect` T@ is /attributed array of elemements of type T/
--
-- Examples (simplified attributes):
--
--  * /x/ is an int
--
-- > int x;
-- > CDeclr "x" []
--
--  * /x/ is a restrict pointer to a const pointer to int
--
-- > const int * const * restrict x;
-- > CDeclr "x" [CPtrDeclr [restrict], CPtrDeclr [const]]
--
--  * /f/ is an function return a constant pointer to int
--
-- > int* const f();
-- > CDeclr "f" [CFunDeclr [],CPtrDeclr [const]]
--
--  * /f/ is a constant pointer to a function returning int
--
-- > int (* const f)(); ==>
-- > CDeclr "f" [CPtrDeclr [const], CFunDeclr []]
type CDeclr = CDeclarator NodeInfo
data CDeclarator a
  = CDeclr (Maybe Ident) [CDerivedDeclarator a] (Maybe (CStringLiteral a)) [CAttribute a] a
    deriving (Int -> CDeclarator a -> ShowS
forall a. Show a => Int -> CDeclarator a -> ShowS
forall a. Show a => [CDeclarator a] -> ShowS
forall a. Show a => CDeclarator a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CDeclarator a] -> ShowS
$cshowList :: forall a. Show a => [CDeclarator a] -> ShowS
show :: CDeclarator a -> String
$cshow :: forall a. Show a => CDeclarator a -> String
showsPrec :: Int -> CDeclarator a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CDeclarator a -> ShowS
Show, CDeclarator a -> DataType
CDeclarator a -> Constr
forall {a}. Data a => Typeable (CDeclarator a)
forall a. Data a => CDeclarator a -> DataType
forall a. Data a => CDeclarator a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> CDeclarator a -> CDeclarator a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CDeclarator a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CDeclarator a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CDeclarator a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CDeclarator a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CDeclarator a -> m (CDeclarator a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CDeclarator a -> m (CDeclarator a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDeclarator a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CDeclarator a -> c (CDeclarator a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CDeclarator a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CDeclarator a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDeclarator a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CDeclarator a -> c (CDeclarator a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CDeclarator a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CDeclarator a -> m (CDeclarator a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CDeclarator a -> m (CDeclarator a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CDeclarator a -> m (CDeclarator a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CDeclarator a -> m (CDeclarator a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CDeclarator a -> m (CDeclarator a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CDeclarator a -> m (CDeclarator a)
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CDeclarator a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CDeclarator a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CDeclarator a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CDeclarator a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CDeclarator a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CDeclarator a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CDeclarator a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CDeclarator a -> r
gmapT :: (forall b. Data b => b -> b) -> CDeclarator a -> CDeclarator a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> CDeclarator a -> CDeclarator a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CDeclarator a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CDeclarator a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CDeclarator a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CDeclarator a))
dataTypeOf :: CDeclarator a -> DataType
$cdataTypeOf :: forall a. Data a => CDeclarator a -> DataType
toConstr :: CDeclarator a -> Constr
$ctoConstr :: forall a. Data a => CDeclarator a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDeclarator a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDeclarator a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CDeclarator a -> c (CDeclarator a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CDeclarator a -> c (CDeclarator a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CDeclarator a) x -> CDeclarator a
forall a x. CDeclarator a -> Rep (CDeclarator a) x
$cto :: forall a x. Rep (CDeclarator a) x -> CDeclarator a
$cfrom :: forall a x. CDeclarator a -> Rep (CDeclarator a) x
Generic, forall a. Rep1 CDeclarator a -> CDeclarator a
forall a. CDeclarator a -> Rep1 CDeclarator a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CDeclarator a -> CDeclarator a
$cfrom1 :: forall a. CDeclarator a -> Rep1 CDeclarator a
Generic1 {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CDeclarator a)


-- | Derived declarators, see 'CDeclr'
--
-- Indirections are qualified using type-qualifiers and generic attributes, and additionally
--
--    * The size of an array is either a constant expression, variable length ('*') or missing; in the last case, the
--      type of the array is incomplete. The qualifier static is allowed for function arguments only, indicating that
--      the supplied argument is an array of at least the given size.
--
--    * New style parameter lists have the form @Right (declarations, isVariadic)@, old style parameter lists have the
--      form @Left (parameter-names)@
type CDerivedDeclr = CDerivedDeclarator NodeInfo
data CDerivedDeclarator a
  = CPtrDeclr [CTypeQualifier a] a
  -- ^ Pointer declarator @CPtrDeclr tyquals declr@
  | CArrDeclr [CTypeQualifier a] (CArraySize a) a
  -- ^ Array declarator @CArrDeclr declr tyquals size-expr?@
  | CFunDeclr (Either [Ident] ([CDeclaration a],Bool)) [CAttribute a] a
    -- ^ Function declarator @CFunDeclr declr (old-style-params | new-style-params) c-attrs@
    deriving (Int -> CDerivedDeclarator a -> ShowS
forall a. Show a => Int -> CDerivedDeclarator a -> ShowS
forall a. Show a => [CDerivedDeclarator a] -> ShowS
forall a. Show a => CDerivedDeclarator a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CDerivedDeclarator a] -> ShowS
$cshowList :: forall a. Show a => [CDerivedDeclarator a] -> ShowS
show :: CDerivedDeclarator a -> String
$cshow :: forall a. Show a => CDerivedDeclarator a -> String
showsPrec :: Int -> CDerivedDeclarator a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CDerivedDeclarator a -> ShowS
Show, CDerivedDeclarator a -> DataType
CDerivedDeclarator a -> Constr
forall {a}. Data a => Typeable (CDerivedDeclarator a)
forall a. Data a => CDerivedDeclarator a -> DataType
forall a. Data a => CDerivedDeclarator a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> CDerivedDeclarator a -> CDerivedDeclarator a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CDerivedDeclarator a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CDerivedDeclarator a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CDerivedDeclarator a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CDerivedDeclarator a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CDerivedDeclarator a -> m (CDerivedDeclarator a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CDerivedDeclarator a -> m (CDerivedDeclarator a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDerivedDeclarator a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CDerivedDeclarator a
-> c (CDerivedDeclarator a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CDerivedDeclarator a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CDerivedDeclarator a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDerivedDeclarator a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CDerivedDeclarator a
-> c (CDerivedDeclarator a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CDerivedDeclarator a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CDerivedDeclarator a -> m (CDerivedDeclarator a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CDerivedDeclarator a -> m (CDerivedDeclarator a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CDerivedDeclarator a -> m (CDerivedDeclarator a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CDerivedDeclarator a -> m (CDerivedDeclarator a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CDerivedDeclarator a -> m (CDerivedDeclarator a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CDerivedDeclarator a -> m (CDerivedDeclarator a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CDerivedDeclarator a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CDerivedDeclarator a -> u
gmapQ :: forall u.
(forall d. Data d => d -> u) -> CDerivedDeclarator a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CDerivedDeclarator a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CDerivedDeclarator a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CDerivedDeclarator a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CDerivedDeclarator a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CDerivedDeclarator a -> r
gmapT :: (forall b. Data b => b -> b)
-> CDerivedDeclarator a -> CDerivedDeclarator a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> CDerivedDeclarator a -> CDerivedDeclarator a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CDerivedDeclarator a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CDerivedDeclarator a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CDerivedDeclarator a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CDerivedDeclarator a))
dataTypeOf :: CDerivedDeclarator a -> DataType
$cdataTypeOf :: forall a. Data a => CDerivedDeclarator a -> DataType
toConstr :: CDerivedDeclarator a -> Constr
$ctoConstr :: forall a. Data a => CDerivedDeclarator a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDerivedDeclarator a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDerivedDeclarator a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CDerivedDeclarator a
-> c (CDerivedDeclarator a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CDerivedDeclarator a
-> c (CDerivedDeclarator a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CDerivedDeclarator a) x -> CDerivedDeclarator a
forall a x. CDerivedDeclarator a -> Rep (CDerivedDeclarator a) x
$cto :: forall a x. Rep (CDerivedDeclarator a) x -> CDerivedDeclarator a
$cfrom :: forall a x. CDerivedDeclarator a -> Rep (CDerivedDeclarator a) x
Generic {-! ,CNode , Annotated !-})

instance NFData a => NFData (CDerivedDeclarator a)

-- Derived instance relies on fmap2
instance Functor CDerivedDeclarator where
        fmap :: forall a b.
(a -> b) -> CDerivedDeclarator a -> CDerivedDeclarator b
fmap a -> b
_f (CPtrDeclr [CTypeQualifier a]
a1 a
a2) = forall a. [CTypeQualifier a] -> a -> CDerivedDeclarator a
CPtrDeclr (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CTypeQualifier a]
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CArrDeclr [CTypeQualifier a]
a1 CArraySize a
a2 a
a3)
          = forall a.
[CTypeQualifier a] -> CArraySize a -> a -> CDerivedDeclarator a
CArrDeclr (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CTypeQualifier a]
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CArraySize a
a2) (a -> b
_f a
a3)
        fmap a -> b
_f (CFunDeclr Either [Ident] ([CDeclaration a], Bool)
a1 [CAttribute a]
a2 a
a3)
          = forall a.
Either [Ident] ([CDeclaration a], Bool)
-> [CAttribute a] -> a -> CDerivedDeclarator a
CFunDeclr (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall {t} {a} {b}. (t -> a) -> (t, b) -> (a, b)
fmapFirst (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f))) Either [Ident] ([CDeclaration a], Bool)
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CAttribute a]
a2)
              (a -> b
_f a
a3)
          where fmapFirst :: (t -> a) -> (t, b) -> (a, b)
fmapFirst t -> a
f (t
a,b
b) = (t -> a
f t
a, b
b)

-- | Size of an array
type CArrSize = CArraySize NodeInfo
data CArraySize a
  = CNoArrSize Bool               -- ^ @CUnknownSize isCompleteType@
  | CArrSize Bool (CExpression a) -- ^ @CArrSize isStatic expr@
    deriving (Int -> CArraySize a -> ShowS
forall a. Show a => Int -> CArraySize a -> ShowS
forall a. Show a => [CArraySize a] -> ShowS
forall a. Show a => CArraySize a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CArraySize a] -> ShowS
$cshowList :: forall a. Show a => [CArraySize a] -> ShowS
show :: CArraySize a -> String
$cshow :: forall a. Show a => CArraySize a -> String
showsPrec :: Int -> CArraySize a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CArraySize a -> ShowS
Show, CArraySize a -> DataType
CArraySize a -> Constr
forall {a}. Data a => Typeable (CArraySize a)
forall a. Data a => CArraySize a -> DataType
forall a. Data a => CArraySize a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> CArraySize a -> CArraySize a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CArraySize a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CArraySize a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CArraySize a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CArraySize a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> CArraySize a -> m (CArraySize a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> CArraySize a -> m (CArraySize a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CArraySize a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CArraySize a -> c (CArraySize a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CArraySize a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CArraySize a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CArraySize a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CArraySize a -> c (CArraySize a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CArraySize a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CArraySize a -> m (CArraySize a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> CArraySize a -> m (CArraySize a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CArraySize a -> m (CArraySize a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> CArraySize a -> m (CArraySize a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CArraySize a -> m (CArraySize a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> CArraySize a -> m (CArraySize a)
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CArraySize a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CArraySize a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CArraySize a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CArraySize a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CArraySize a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CArraySize a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CArraySize a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CArraySize a -> r
gmapT :: (forall b. Data b => b -> b) -> CArraySize a -> CArraySize a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> CArraySize a -> CArraySize a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CArraySize a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CArraySize a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CArraySize a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CArraySize a))
dataTypeOf :: CArraySize a -> DataType
$cdataTypeOf :: forall a. Data a => CArraySize a -> DataType
toConstr :: CArraySize a -> Constr
$ctoConstr :: forall a. Data a => CArraySize a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CArraySize a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CArraySize a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CArraySize a -> c (CArraySize a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CArraySize a -> c (CArraySize a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CArraySize a) x -> CArraySize a
forall a x. CArraySize a -> Rep (CArraySize a) x
$cto :: forall a x. Rep (CArraySize a) x -> CArraySize a
$cfrom :: forall a x. CArraySize a -> Rep (CArraySize a) x
Generic, forall a. Rep1 CArraySize a -> CArraySize a
forall a. CArraySize a -> Rep1 CArraySize a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CArraySize a -> CArraySize a
$cfrom1 :: forall a. CArraySize a -> Rep1 CArraySize a
Generic1 {-! , Functor !-})

instance NFData a => NFData (CArraySize a)

-- | C statement (K&R A9, C99 6.8)
--
type CStat = CStatement NodeInfo
data CStatement a
  -- | An (attributed) label followed by a statement
  = CLabel  Ident (CStatement a) [CAttribute a] a
  -- | A statement of the form @case expr : stmt@
  | CCase (CExpression a) (CStatement a) a
  -- | A case range of the form @case lower ... upper : stmt@
  | CCases (CExpression a) (CExpression a) (CStatement a) a
  -- | The default case @default : stmt@
  | CDefault (CStatement a) a
  -- | A simple statement, that is in C: evaluating an expression with
  --   side-effects and discarding the result.
  | CExpr (Maybe (CExpression a)) a
  -- | compound statement @CCompound localLabels blockItems at@
  | CCompound [Ident] [CCompoundBlockItem a] a
  -- | conditional statement @CIf ifExpr thenStmt maybeElseStmt at@
  | CIf (CExpression a) (CStatement a) (Maybe (CStatement a)) a
  -- | switch statement @CSwitch selectorExpr switchStmt@, where
  -- @switchStmt@ usually includes /case/, /break/ and /default/
  -- statements
  | CSwitch (CExpression a) (CStatement a) a
  -- | while or do-while statement @CWhile guard stmt isDoWhile at@
  | CWhile (CExpression a) (CStatement a) Bool a
  -- | for statement @CFor init expr-2 expr-3 stmt@, where @init@ is
  -- either a declaration or initializing expression
  | CFor (Either (Maybe (CExpression a)) (CDeclaration a))
    (Maybe (CExpression a))
    (Maybe (CExpression a))
    (CStatement a)
    a
  -- | goto statement @CGoto label@
  | CGoto Ident a
  -- | computed goto @CGotoPtr labelExpr@
  | CGotoPtr (CExpression a) a
  -- | continue statement
  | CCont a
  -- | break statement
  | CBreak a
  -- | return statement @CReturn returnExpr@
  | CReturn (Maybe (CExpression a)) a
  -- | assembly statement
  | CAsm (CAssemblyStatement a) a
    deriving (Int -> CStatement a -> ShowS
forall a. Show a => Int -> CStatement a -> ShowS
forall a. Show a => [CStatement a] -> ShowS
forall a. Show a => CStatement a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CStatement a] -> ShowS
$cshowList :: forall a. Show a => [CStatement a] -> ShowS
show :: CStatement a -> String
$cshow :: forall a. Show a => CStatement a -> String
showsPrec :: Int -> CStatement a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CStatement a -> ShowS
Show, CStatement a -> DataType
CStatement a -> Constr
forall {a}. Data a => Typeable (CStatement a)
forall a. Data a => CStatement a -> DataType
forall a. Data a => CStatement a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> CStatement a -> CStatement a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CStatement a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CStatement a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CStatement a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CStatement a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> CStatement a -> m (CStatement a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> CStatement a -> m (CStatement a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStatement a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CStatement a -> c (CStatement a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CStatement a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CStatement a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStatement a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CStatement a -> c (CStatement a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CStatement a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CStatement a -> m (CStatement a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> CStatement a -> m (CStatement a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CStatement a -> m (CStatement a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> CStatement a -> m (CStatement a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CStatement a -> m (CStatement a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> CStatement a -> m (CStatement a)
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CStatement a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CStatement a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CStatement a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CStatement a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CStatement a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CStatement a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CStatement a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CStatement a -> r
gmapT :: (forall b. Data b => b -> b) -> CStatement a -> CStatement a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> CStatement a -> CStatement a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CStatement a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CStatement a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CStatement a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CStatement a))
dataTypeOf :: CStatement a -> DataType
$cdataTypeOf :: forall a. Data a => CStatement a -> DataType
toConstr :: CStatement a -> Constr
$ctoConstr :: forall a. Data a => CStatement a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStatement a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStatement a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CStatement a -> c (CStatement a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CStatement a -> c (CStatement a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CStatement a) x -> CStatement a
forall a x. CStatement a -> Rep (CStatement a) x
$cto :: forall a x. Rep (CStatement a) x -> CStatement a
$cfrom :: forall a x. CStatement a -> Rep (CStatement a) x
Generic {-! , CNode , Annotated !-})

instance NFData a => NFData (CStatement a)

-- Derived instance relies on fmap2 :(
instance Functor CStatement where
        fmap :: forall a b. (a -> b) -> CStatement a -> CStatement b
fmap a -> b
_f (CLabel Ident
a1 CStatement a
a2 [CAttribute a]
a3 a
a4)
          = forall a.
Ident -> CStatement a -> [CAttribute a] -> a -> CStatement a
CLabel Ident
a1 (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStatement a
a2) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CAttribute a]
a3) (a -> b
_f a
a4)
        fmap a -> b
_f (CCase CExpression a
a1 CStatement a
a2 a
a3) = forall a. CExpression a -> CStatement a -> a -> CStatement a
CCase (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStatement a
a2) (a -> b
_f a
a3)
        fmap a -> b
_f (CCases CExpression a
a1 CExpression a
a2 CStatement a
a3 a
a4)
          = forall a.
CExpression a -> CExpression a -> CStatement a -> a -> CStatement a
CCases (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a2) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStatement a
a3) (a -> b
_f a
a4)
        fmap a -> b
_f (CDefault CStatement a
a1 a
a2) = forall a. CStatement a -> a -> CStatement a
CDefault (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStatement a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CExpr Maybe (CExpression a)
a1 a
a2) = forall a. Maybe (CExpression a) -> a -> CStatement a
CExpr (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) Maybe (CExpression a)
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CCompound [Ident]
a1 [CCompoundBlockItem a]
a2 a
a3)
          = forall a. [Ident] -> [CCompoundBlockItem a] -> a -> CStatement a
CCompound [Ident]
a1 (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CCompoundBlockItem a]
a2) (a -> b
_f a
a3)
        fmap a -> b
_f (CIf CExpression a
a1 CStatement a
a2 Maybe (CStatement a)
a3 a
a4)
          = forall a.
CExpression a
-> CStatement a -> Maybe (CStatement a) -> a -> CStatement a
CIf (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStatement a
a2) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) Maybe (CStatement a)
a3) (a -> b
_f a
a4)
        fmap a -> b
_f (CSwitch CExpression a
a1 CStatement a
a2 a
a3)
          = forall a. CExpression a -> CStatement a -> a -> CStatement a
CSwitch (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStatement a
a2) (a -> b
_f a
a3)
        fmap a -> b
_f (CWhile CExpression a
a1 CStatement a
a2 Bool
a3 a
a4)
          = forall a.
CExpression a -> CStatement a -> Bool -> a -> CStatement a
CWhile (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStatement a
a2) Bool
a3 (a -> b
_f a
a4)
        fmap a -> b
_f (CFor Either (Maybe (CExpression a)) (CDeclaration a)
a1 Maybe (CExpression a)
a2 Maybe (CExpression a)
a3 CStatement a
a4 a
a5)
          = forall a.
Either (Maybe (CExpression a)) (CDeclaration a)
-> Maybe (CExpression a)
-> Maybe (CExpression a)
-> CStatement a
-> a
-> CStatement a
CFor (forall {a} {b} {b} {b}.
(a -> b) -> (b -> b) -> Either a b -> Either b b
mapEither (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f)) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) Either (Maybe (CExpression a)) (CDeclaration a)
a1)
                 (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) Maybe (CExpression a)
a2) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) Maybe (CExpression a)
a3) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStatement a
a4)
                 (a -> b
_f a
a5)
          where mapEither :: (a -> b) -> (b -> b) -> Either a b -> Either b b
mapEither a -> b
f1 b -> b
f2 = forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either (forall a b. a -> Either a b
Left forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> b
f1) (forall a b. b -> Either a b
Right forall b c a. (b -> c) -> (a -> b) -> a -> c
. b -> b
f2)
        fmap a -> b
_f (CGoto Ident
a1 a
a2) = forall a. Ident -> a -> CStatement a
CGoto Ident
a1 (a -> b
_f a
a2)
        fmap a -> b
_f (CGotoPtr CExpression a
a1 a
a2) = forall a. CExpression a -> a -> CStatement a
CGotoPtr (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CCont a
a1) = forall a. a -> CStatement a
CCont (a -> b
_f a
a1)
        fmap a -> b
_f (CBreak a
a1) = forall a. a -> CStatement a
CBreak (a -> b
_f a
a1)
        fmap a -> b
_f (CReturn Maybe (CExpression a)
a1 a
a2) = forall a. Maybe (CExpression a) -> a -> CStatement a
CReturn (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) Maybe (CExpression a)
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CAsm CAssemblyStatement a
a1 a
a2) = forall a. CAssemblyStatement a -> a -> CStatement a
CAsm (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CAssemblyStatement a
a1) (a -> b
_f a
a2)

-- | GNU Assembler statement
--
-- > CAssemblyStatement type-qual? asm-expr out-ops in-ops clobbers _
--
-- is an inline assembler statement.
-- The only type-qualifier (if any) allowed is /volatile/.
-- @asm-expr@ is the actual assembler epxression (a string), @out-ops@ and @in-ops@ are the input
-- and output operands of the statement.
-- @clobbers@ is a list of registers which are clobbered when executing the assembler statement
type CAsmStmt = CAssemblyStatement NodeInfo
data CAssemblyStatement a
  = CAsmStmt
    (Maybe (CTypeQualifier a)) -- maybe volatile
    (CStringLiteral a)         -- assembler expression (String)
    [CAssemblyOperand a]       -- output operands
    [CAssemblyOperand a]       -- input operands
    [CStringLiteral a]         -- Clobbers
    a
    deriving (Int -> CAssemblyStatement a -> ShowS
forall a. Show a => Int -> CAssemblyStatement a -> ShowS
forall a. Show a => [CAssemblyStatement a] -> ShowS
forall a. Show a => CAssemblyStatement a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CAssemblyStatement a] -> ShowS
$cshowList :: forall a. Show a => [CAssemblyStatement a] -> ShowS
show :: CAssemblyStatement a -> String
$cshow :: forall a. Show a => CAssemblyStatement a -> String
showsPrec :: Int -> CAssemblyStatement a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CAssemblyStatement a -> ShowS
Show, CAssemblyStatement a -> DataType
CAssemblyStatement a -> Constr
forall {a}. Data a => Typeable (CAssemblyStatement a)
forall a. Data a => CAssemblyStatement a -> DataType
forall a. Data a => CAssemblyStatement a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> CAssemblyStatement a -> CAssemblyStatement a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CAssemblyStatement a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CAssemblyStatement a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CAssemblyStatement a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CAssemblyStatement a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CAssemblyStatement a -> m (CAssemblyStatement a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CAssemblyStatement a -> m (CAssemblyStatement a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAssemblyStatement a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CAssemblyStatement a
-> c (CAssemblyStatement a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CAssemblyStatement a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CAssemblyStatement a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAssemblyStatement a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CAssemblyStatement a
-> c (CAssemblyStatement a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CAssemblyStatement a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CAssemblyStatement a -> m (CAssemblyStatement a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CAssemblyStatement a -> m (CAssemblyStatement a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CAssemblyStatement a -> m (CAssemblyStatement a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CAssemblyStatement a -> m (CAssemblyStatement a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CAssemblyStatement a -> m (CAssemblyStatement a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CAssemblyStatement a -> m (CAssemblyStatement a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CAssemblyStatement a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CAssemblyStatement a -> u
gmapQ :: forall u.
(forall d. Data d => d -> u) -> CAssemblyStatement a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CAssemblyStatement a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CAssemblyStatement a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CAssemblyStatement a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CAssemblyStatement a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CAssemblyStatement a -> r
gmapT :: (forall b. Data b => b -> b)
-> CAssemblyStatement a -> CAssemblyStatement a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> CAssemblyStatement a -> CAssemblyStatement a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CAssemblyStatement a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CAssemblyStatement a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CAssemblyStatement a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CAssemblyStatement a))
dataTypeOf :: CAssemblyStatement a -> DataType
$cdataTypeOf :: forall a. Data a => CAssemblyStatement a -> DataType
toConstr :: CAssemblyStatement a -> Constr
$ctoConstr :: forall a. Data a => CAssemblyStatement a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAssemblyStatement a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAssemblyStatement a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CAssemblyStatement a
-> c (CAssemblyStatement a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CAssemblyStatement a
-> c (CAssemblyStatement a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CAssemblyStatement a) x -> CAssemblyStatement a
forall a x. CAssemblyStatement a -> Rep (CAssemblyStatement a) x
$cto :: forall a x. Rep (CAssemblyStatement a) x -> CAssemblyStatement a
$cfrom :: forall a x. CAssemblyStatement a -> Rep (CAssemblyStatement a) x
Generic, forall a. Rep1 CAssemblyStatement a -> CAssemblyStatement a
forall a. CAssemblyStatement a -> Rep1 CAssemblyStatement a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CAssemblyStatement a -> CAssemblyStatement a
$cfrom1 :: forall a. CAssemblyStatement a -> Rep1 CAssemblyStatement a
Generic1 {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CAssemblyStatement a)

-- | Assembler operand
--
-- @CAsmOperand argName? constraintExpr arg@ specifies an operand for an assembler
-- statement.
type CAsmOperand = CAssemblyOperand NodeInfo
data CAssemblyOperand a
  = CAsmOperand
    (Maybe Ident)       -- argument name
    (CStringLiteral a)  -- constraint expr
    (CExpression a)     -- argument
    a
    deriving (Int -> CAssemblyOperand a -> ShowS
forall a. Show a => Int -> CAssemblyOperand a -> ShowS
forall a. Show a => [CAssemblyOperand a] -> ShowS
forall a. Show a => CAssemblyOperand a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CAssemblyOperand a] -> ShowS
$cshowList :: forall a. Show a => [CAssemblyOperand a] -> ShowS
show :: CAssemblyOperand a -> String
$cshow :: forall a. Show a => CAssemblyOperand a -> String
showsPrec :: Int -> CAssemblyOperand a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CAssemblyOperand a -> ShowS
Show, CAssemblyOperand a -> DataType
CAssemblyOperand a -> Constr
forall {a}. Data a => Typeable (CAssemblyOperand a)
forall a. Data a => CAssemblyOperand a -> DataType
forall a. Data a => CAssemblyOperand a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> CAssemblyOperand a -> CAssemblyOperand a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CAssemblyOperand a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CAssemblyOperand a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CAssemblyOperand a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CAssemblyOperand a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CAssemblyOperand a -> m (CAssemblyOperand a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CAssemblyOperand a -> m (CAssemblyOperand a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAssemblyOperand a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CAssemblyOperand a
-> c (CAssemblyOperand a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CAssemblyOperand a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CAssemblyOperand a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAssemblyOperand a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CAssemblyOperand a
-> c (CAssemblyOperand a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CAssemblyOperand a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CAssemblyOperand a -> m (CAssemblyOperand a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CAssemblyOperand a -> m (CAssemblyOperand a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CAssemblyOperand a -> m (CAssemblyOperand a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CAssemblyOperand a -> m (CAssemblyOperand a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CAssemblyOperand a -> m (CAssemblyOperand a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CAssemblyOperand a -> m (CAssemblyOperand a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CAssemblyOperand a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CAssemblyOperand a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CAssemblyOperand a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CAssemblyOperand a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CAssemblyOperand a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CAssemblyOperand a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CAssemblyOperand a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CAssemblyOperand a -> r
gmapT :: (forall b. Data b => b -> b)
-> CAssemblyOperand a -> CAssemblyOperand a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> CAssemblyOperand a -> CAssemblyOperand a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CAssemblyOperand a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CAssemblyOperand a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CAssemblyOperand a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CAssemblyOperand a))
dataTypeOf :: CAssemblyOperand a -> DataType
$cdataTypeOf :: forall a. Data a => CAssemblyOperand a -> DataType
toConstr :: CAssemblyOperand a -> Constr
$ctoConstr :: forall a. Data a => CAssemblyOperand a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAssemblyOperand a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAssemblyOperand a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CAssemblyOperand a
-> c (CAssemblyOperand a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CAssemblyOperand a
-> c (CAssemblyOperand a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CAssemblyOperand a) x -> CAssemblyOperand a
forall a x. CAssemblyOperand a -> Rep (CAssemblyOperand a) x
$cto :: forall a x. Rep (CAssemblyOperand a) x -> CAssemblyOperand a
$cfrom :: forall a x. CAssemblyOperand a -> Rep (CAssemblyOperand a) x
Generic, forall a. Rep1 CAssemblyOperand a -> CAssemblyOperand a
forall a. CAssemblyOperand a -> Rep1 CAssemblyOperand a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CAssemblyOperand a -> CAssemblyOperand a
$cfrom1 :: forall a. CAssemblyOperand a -> Rep1 CAssemblyOperand a
Generic1 {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CAssemblyOperand a)

-- | C99 Block items
--
--  Things that may appear in compound statements: either statements, declarations
--   or nested function definitions.
type CBlockItem = CCompoundBlockItem NodeInfo
data CCompoundBlockItem a
  = CBlockStmt    (CStatement a)    -- ^ A statement
  | CBlockDecl    (CDeclaration a)  -- ^ A local declaration
  | CNestedFunDef (CFunctionDef a)  -- ^ A nested function (GNU C)
    deriving (Int -> CCompoundBlockItem a -> ShowS
forall a. Show a => Int -> CCompoundBlockItem a -> ShowS
forall a. Show a => [CCompoundBlockItem a] -> ShowS
forall a. Show a => CCompoundBlockItem a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CCompoundBlockItem a] -> ShowS
$cshowList :: forall a. Show a => [CCompoundBlockItem a] -> ShowS
show :: CCompoundBlockItem a -> String
$cshow :: forall a. Show a => CCompoundBlockItem a -> String
showsPrec :: Int -> CCompoundBlockItem a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CCompoundBlockItem a -> ShowS
Show, CCompoundBlockItem a -> DataType
CCompoundBlockItem a -> Constr
forall {a}. Data a => Typeable (CCompoundBlockItem a)
forall a. Data a => CCompoundBlockItem a -> DataType
forall a. Data a => CCompoundBlockItem a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> CCompoundBlockItem a -> CCompoundBlockItem a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CCompoundBlockItem a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CCompoundBlockItem a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CCompoundBlockItem a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CCompoundBlockItem a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CCompoundBlockItem a -> m (CCompoundBlockItem a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CCompoundBlockItem a -> m (CCompoundBlockItem a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CCompoundBlockItem a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CCompoundBlockItem a
-> c (CCompoundBlockItem a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CCompoundBlockItem a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CCompoundBlockItem a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CCompoundBlockItem a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CCompoundBlockItem a
-> c (CCompoundBlockItem a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CCompoundBlockItem a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CCompoundBlockItem a -> m (CCompoundBlockItem a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CCompoundBlockItem a -> m (CCompoundBlockItem a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CCompoundBlockItem a -> m (CCompoundBlockItem a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CCompoundBlockItem a -> m (CCompoundBlockItem a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CCompoundBlockItem a -> m (CCompoundBlockItem a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CCompoundBlockItem a -> m (CCompoundBlockItem a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CCompoundBlockItem a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CCompoundBlockItem a -> u
gmapQ :: forall u.
(forall d. Data d => d -> u) -> CCompoundBlockItem a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CCompoundBlockItem a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CCompoundBlockItem a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CCompoundBlockItem a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CCompoundBlockItem a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CCompoundBlockItem a -> r
gmapT :: (forall b. Data b => b -> b)
-> CCompoundBlockItem a -> CCompoundBlockItem a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> CCompoundBlockItem a -> CCompoundBlockItem a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CCompoundBlockItem a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CCompoundBlockItem a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CCompoundBlockItem a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CCompoundBlockItem a))
dataTypeOf :: CCompoundBlockItem a -> DataType
$cdataTypeOf :: forall a. Data a => CCompoundBlockItem a -> DataType
toConstr :: CCompoundBlockItem a -> Constr
$ctoConstr :: forall a. Data a => CCompoundBlockItem a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CCompoundBlockItem a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CCompoundBlockItem a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CCompoundBlockItem a
-> c (CCompoundBlockItem a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CCompoundBlockItem a
-> c (CCompoundBlockItem a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CCompoundBlockItem a) x -> CCompoundBlockItem a
forall a x. CCompoundBlockItem a -> Rep (CCompoundBlockItem a) x
$cto :: forall a x. Rep (CCompoundBlockItem a) x -> CCompoundBlockItem a
$cfrom :: forall a x. CCompoundBlockItem a -> Rep (CCompoundBlockItem a) x
Generic, forall a. Rep1 CCompoundBlockItem a -> CCompoundBlockItem a
forall a. CCompoundBlockItem a -> Rep1 CCompoundBlockItem a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CCompoundBlockItem a -> CCompoundBlockItem a
$cfrom1 :: forall a. CCompoundBlockItem a -> Rep1 CCompoundBlockItem a
Generic1 {-! , CNode , Functor, Annotated !-})

instance NFData a => NFData (CCompoundBlockItem a)

-- | C declaration specifiers and qualifiers
--
-- Declaration specifiers include at most one storage-class specifier (C99 6.7.1),
-- type specifiers (6.7.2) and type qualifiers (6.7.3).
type CDeclSpec = CDeclarationSpecifier NodeInfo
data CDeclarationSpecifier a
  = CStorageSpec (CStorageSpecifier a) -- ^ storage-class specifier or typedef
  | CTypeSpec    (CTypeSpecifier a)    -- ^ type name
  | CTypeQual    (CTypeQualifier a)    -- ^ type qualifier
  | CFunSpec     (CFunctionSpecifier a) -- ^ function specifier
  | CAlignSpec   (CAlignmentSpecifier a) -- ^ alignment specifier
    deriving (Int -> CDeclarationSpecifier a -> ShowS
forall a. Show a => Int -> CDeclarationSpecifier a -> ShowS
forall a. Show a => [CDeclarationSpecifier a] -> ShowS
forall a. Show a => CDeclarationSpecifier a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CDeclarationSpecifier a] -> ShowS
$cshowList :: forall a. Show a => [CDeclarationSpecifier a] -> ShowS
show :: CDeclarationSpecifier a -> String
$cshow :: forall a. Show a => CDeclarationSpecifier a -> String
showsPrec :: Int -> CDeclarationSpecifier a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CDeclarationSpecifier a -> ShowS
Show, CDeclarationSpecifier a -> DataType
CDeclarationSpecifier a -> Constr
forall {a}. Data a => Typeable (CDeclarationSpecifier a)
forall a. Data a => CDeclarationSpecifier a -> DataType
forall a. Data a => CDeclarationSpecifier a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> CDeclarationSpecifier a -> CDeclarationSpecifier a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CDeclarationSpecifier a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CDeclarationSpecifier a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> CDeclarationSpecifier a
-> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> CDeclarationSpecifier a
-> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CDeclarationSpecifier a -> m (CDeclarationSpecifier a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CDeclarationSpecifier a -> m (CDeclarationSpecifier a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDeclarationSpecifier a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CDeclarationSpecifier a
-> c (CDeclarationSpecifier a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d))
-> Maybe (c (CDeclarationSpecifier a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CDeclarationSpecifier a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDeclarationSpecifier a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CDeclarationSpecifier a
-> c (CDeclarationSpecifier a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c (CDeclarationSpecifier a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CDeclarationSpecifier a -> m (CDeclarationSpecifier a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CDeclarationSpecifier a -> m (CDeclarationSpecifier a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CDeclarationSpecifier a -> m (CDeclarationSpecifier a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CDeclarationSpecifier a -> m (CDeclarationSpecifier a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CDeclarationSpecifier a -> m (CDeclarationSpecifier a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CDeclarationSpecifier a -> m (CDeclarationSpecifier a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CDeclarationSpecifier a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CDeclarationSpecifier a -> u
gmapQ :: forall u.
(forall d. Data d => d -> u) -> CDeclarationSpecifier a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CDeclarationSpecifier a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> CDeclarationSpecifier a
-> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> CDeclarationSpecifier a
-> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> CDeclarationSpecifier a
-> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> CDeclarationSpecifier a
-> r
gmapT :: (forall b. Data b => b -> b)
-> CDeclarationSpecifier a -> CDeclarationSpecifier a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> CDeclarationSpecifier a -> CDeclarationSpecifier a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CDeclarationSpecifier a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CDeclarationSpecifier a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c (CDeclarationSpecifier a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d))
-> Maybe (c (CDeclarationSpecifier a))
dataTypeOf :: CDeclarationSpecifier a -> DataType
$cdataTypeOf :: forall a. Data a => CDeclarationSpecifier a -> DataType
toConstr :: CDeclarationSpecifier a -> Constr
$ctoConstr :: forall a. Data a => CDeclarationSpecifier a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDeclarationSpecifier a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CDeclarationSpecifier a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CDeclarationSpecifier a
-> c (CDeclarationSpecifier a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CDeclarationSpecifier a
-> c (CDeclarationSpecifier a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x.
Rep (CDeclarationSpecifier a) x -> CDeclarationSpecifier a
forall a x.
CDeclarationSpecifier a -> Rep (CDeclarationSpecifier a) x
$cto :: forall a x.
Rep (CDeclarationSpecifier a) x -> CDeclarationSpecifier a
$cfrom :: forall a x.
CDeclarationSpecifier a -> Rep (CDeclarationSpecifier a) x
Generic, forall a. Rep1 CDeclarationSpecifier a -> CDeclarationSpecifier a
forall a. CDeclarationSpecifier a -> Rep1 CDeclarationSpecifier a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CDeclarationSpecifier a -> CDeclarationSpecifier a
$cfrom1 :: forall a. CDeclarationSpecifier a -> Rep1 CDeclarationSpecifier a
Generic1 {-! ,CNode ,Functor, Annotated !-})

instance NFData a => NFData (CDeclarationSpecifier a)

-- | Separate the declaration specifiers
--
-- @__attribute__@ of a declaration qualify declarations or declarators (but not types),
-- and are therefore separated as well.
partitionDeclSpecs :: [CDeclarationSpecifier a]
                   -> ( [CStorageSpecifier a], [CAttribute a]
                      , [CTypeQualifier a], [CTypeSpecifier a]
                      , [CFunctionSpecifier a], [CAlignmentSpecifier a])
partitionDeclSpecs :: forall a.
[CDeclarationSpecifier a]
-> ([CStorageSpecifier a], [CAttribute a], [CTypeQualifier a],
    [CTypeSpecifier a], [CFunctionSpecifier a],
    [CAlignmentSpecifier a])
partitionDeclSpecs = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr forall {a}.
CDeclarationSpecifier a
-> ([CStorageSpecifier a], [CAttribute a], [CTypeQualifier a],
    [CTypeSpecifier a], [CFunctionSpecifier a],
    [CAlignmentSpecifier a])
-> ([CStorageSpecifier a], [CAttribute a], [CTypeQualifier a],
    [CTypeSpecifier a], [CFunctionSpecifier a],
    [CAlignmentSpecifier a])
deals ([],[],[],[],[],[]) where
    deals :: CDeclarationSpecifier a
-> ([CStorageSpecifier a], [CAttribute a], [CTypeQualifier a],
    [CTypeSpecifier a], [CFunctionSpecifier a],
    [CAlignmentSpecifier a])
-> ([CStorageSpecifier a], [CAttribute a], [CTypeQualifier a],
    [CTypeSpecifier a], [CFunctionSpecifier a],
    [CAlignmentSpecifier a])
deals (CStorageSpec CStorageSpecifier a
sp) ([CStorageSpecifier a]
sts,[CAttribute a]
ats,[CTypeQualifier a]
tqs,[CTypeSpecifier a]
tss,[CFunctionSpecifier a]
fss,[CAlignmentSpecifier a]
ass)  = (CStorageSpecifier a
spforall a. a -> [a] -> [a]
:[CStorageSpecifier a]
sts,[CAttribute a]
ats,[CTypeQualifier a]
tqs,[CTypeSpecifier a]
tss,[CFunctionSpecifier a]
fss,[CAlignmentSpecifier a]
ass)
    deals (CTypeQual (CAttrQual CAttribute a
attr)) ([CStorageSpecifier a]
sts,[CAttribute a]
ats,[CTypeQualifier a]
tqs,[CTypeSpecifier a]
tss,[CFunctionSpecifier a]
fss,[CAlignmentSpecifier a]
ass)  = ([CStorageSpecifier a]
sts,CAttribute a
attrforall a. a -> [a] -> [a]
:[CAttribute a]
ats,[CTypeQualifier a]
tqs,[CTypeSpecifier a]
tss,[CFunctionSpecifier a]
fss,[CAlignmentSpecifier a]
ass)
    deals (CTypeQual CTypeQualifier a
tq) ([CStorageSpecifier a]
sts,[CAttribute a]
ats,[CTypeQualifier a]
tqs,[CTypeSpecifier a]
tss,[CFunctionSpecifier a]
fss,[CAlignmentSpecifier a]
ass)     = ([CStorageSpecifier a]
sts,[CAttribute a]
ats,CTypeQualifier a
tqforall a. a -> [a] -> [a]
:[CTypeQualifier a]
tqs,[CTypeSpecifier a]
tss,[CFunctionSpecifier a]
fss,[CAlignmentSpecifier a]
ass)
    deals (CTypeSpec CTypeSpecifier a
ts) ([CStorageSpecifier a]
sts,[CAttribute a]
ats,[CTypeQualifier a]
tqs,[CTypeSpecifier a]
tss,[CFunctionSpecifier a]
fss,[CAlignmentSpecifier a]
ass)     = ([CStorageSpecifier a]
sts,[CAttribute a]
ats,[CTypeQualifier a]
tqs,CTypeSpecifier a
tsforall a. a -> [a] -> [a]
:[CTypeSpecifier a]
tss,[CFunctionSpecifier a]
fss,[CAlignmentSpecifier a]
ass)
    deals (CFunSpec CFunctionSpecifier a
fs) ([CStorageSpecifier a]
sts,[CAttribute a]
ats,[CTypeQualifier a]
tqs,[CTypeSpecifier a]
tss,[CFunctionSpecifier a]
fss,[CAlignmentSpecifier a]
ass)      = ([CStorageSpecifier a]
sts,[CAttribute a]
ats,[CTypeQualifier a]
tqs,[CTypeSpecifier a]
tss,CFunctionSpecifier a
fsforall a. a -> [a] -> [a]
:[CFunctionSpecifier a]
fss,[CAlignmentSpecifier a]
ass)
    deals (CAlignSpec CAlignmentSpecifier a
as) ([CStorageSpecifier a]
sts,[CAttribute a]
ats,[CTypeQualifier a]
tqs,[CTypeSpecifier a]
tss,[CFunctionSpecifier a]
fss,[CAlignmentSpecifier a]
ass)    = ([CStorageSpecifier a]
sts,[CAttribute a]
ats,[CTypeQualifier a]
tqs,[CTypeSpecifier a]
tss,[CFunctionSpecifier a]
fss,CAlignmentSpecifier a
asforall a. a -> [a] -> [a]
:[CAlignmentSpecifier a]
ass)

-- | C storage class specifier (and typedefs) (K&R A8.1, C99 6.7.1)
type CStorageSpec = CStorageSpecifier NodeInfo
data CStorageSpecifier a
  = CAuto     a     -- ^ auto
  | CRegister a     -- ^ register
  | CStatic   a     -- ^ static
  | CExtern   a     -- ^ extern
  | CTypedef  a     -- ^ typedef
  | CThread   a     -- ^ C11/GNUC thread local storage
  | CClKernel a     -- ^ OpenCL kernel function
  | CClGlobal a     -- ^ OpenCL __global variable
  | CClLocal  a     -- ^ OpenCL __local variable
    deriving (Int -> CStorageSpecifier a -> ShowS
forall a. Show a => Int -> CStorageSpecifier a -> ShowS
forall a. Show a => [CStorageSpecifier a] -> ShowS
forall a. Show a => CStorageSpecifier a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CStorageSpecifier a] -> ShowS
$cshowList :: forall a. Show a => [CStorageSpecifier a] -> ShowS
show :: CStorageSpecifier a -> String
$cshow :: forall a. Show a => CStorageSpecifier a -> String
showsPrec :: Int -> CStorageSpecifier a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CStorageSpecifier a -> ShowS
Show, CStorageSpecifier a -> CStorageSpecifier a -> Bool
forall a.
Eq a =>
CStorageSpecifier a -> CStorageSpecifier a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CStorageSpecifier a -> CStorageSpecifier a -> Bool
$c/= :: forall a.
Eq a =>
CStorageSpecifier a -> CStorageSpecifier a -> Bool
== :: CStorageSpecifier a -> CStorageSpecifier a -> Bool
$c== :: forall a.
Eq a =>
CStorageSpecifier a -> CStorageSpecifier a -> Bool
Eq,CStorageSpecifier a -> CStorageSpecifier a -> Ordering
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall {a}. Ord a => Eq (CStorageSpecifier a)
forall a.
Ord a =>
CStorageSpecifier a -> CStorageSpecifier a -> Bool
forall a.
Ord a =>
CStorageSpecifier a -> CStorageSpecifier a -> Ordering
forall a.
Ord a =>
CStorageSpecifier a -> CStorageSpecifier a -> CStorageSpecifier a
min :: CStorageSpecifier a -> CStorageSpecifier a -> CStorageSpecifier a
$cmin :: forall a.
Ord a =>
CStorageSpecifier a -> CStorageSpecifier a -> CStorageSpecifier a
max :: CStorageSpecifier a -> CStorageSpecifier a -> CStorageSpecifier a
$cmax :: forall a.
Ord a =>
CStorageSpecifier a -> CStorageSpecifier a -> CStorageSpecifier a
>= :: CStorageSpecifier a -> CStorageSpecifier a -> Bool
$c>= :: forall a.
Ord a =>
CStorageSpecifier a -> CStorageSpecifier a -> Bool
> :: CStorageSpecifier a -> CStorageSpecifier a -> Bool
$c> :: forall a.
Ord a =>
CStorageSpecifier a -> CStorageSpecifier a -> Bool
<= :: CStorageSpecifier a -> CStorageSpecifier a -> Bool
$c<= :: forall a.
Ord a =>
CStorageSpecifier a -> CStorageSpecifier a -> Bool
< :: CStorageSpecifier a -> CStorageSpecifier a -> Bool
$c< :: forall a.
Ord a =>
CStorageSpecifier a -> CStorageSpecifier a -> Bool
compare :: CStorageSpecifier a -> CStorageSpecifier a -> Ordering
$ccompare :: forall a.
Ord a =>
CStorageSpecifier a -> CStorageSpecifier a -> Ordering
Ord,CStorageSpecifier a -> DataType
CStorageSpecifier a -> Constr
forall {a}. Data a => Typeable (CStorageSpecifier a)
forall a. Data a => CStorageSpecifier a -> DataType
forall a. Data a => CStorageSpecifier a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> CStorageSpecifier a -> CStorageSpecifier a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CStorageSpecifier a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CStorageSpecifier a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CStorageSpecifier a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CStorageSpecifier a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CStorageSpecifier a -> m (CStorageSpecifier a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CStorageSpecifier a -> m (CStorageSpecifier a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStorageSpecifier a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CStorageSpecifier a
-> c (CStorageSpecifier a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CStorageSpecifier a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CStorageSpecifier a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStorageSpecifier a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CStorageSpecifier a
-> c (CStorageSpecifier a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CStorageSpecifier a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CStorageSpecifier a -> m (CStorageSpecifier a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CStorageSpecifier a -> m (CStorageSpecifier a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CStorageSpecifier a -> m (CStorageSpecifier a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CStorageSpecifier a -> m (CStorageSpecifier a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CStorageSpecifier a -> m (CStorageSpecifier a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CStorageSpecifier a -> m (CStorageSpecifier a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CStorageSpecifier a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CStorageSpecifier a -> u
gmapQ :: forall u.
(forall d. Data d => d -> u) -> CStorageSpecifier a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CStorageSpecifier a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CStorageSpecifier a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CStorageSpecifier a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CStorageSpecifier a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CStorageSpecifier a -> r
gmapT :: (forall b. Data b => b -> b)
-> CStorageSpecifier a -> CStorageSpecifier a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> CStorageSpecifier a -> CStorageSpecifier a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CStorageSpecifier a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CStorageSpecifier a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CStorageSpecifier a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CStorageSpecifier a))
dataTypeOf :: CStorageSpecifier a -> DataType
$cdataTypeOf :: forall a. Data a => CStorageSpecifier a -> DataType
toConstr :: CStorageSpecifier a -> Constr
$ctoConstr :: forall a. Data a => CStorageSpecifier a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStorageSpecifier a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStorageSpecifier a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CStorageSpecifier a
-> c (CStorageSpecifier a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CStorageSpecifier a
-> c (CStorageSpecifier a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CStorageSpecifier a) x -> CStorageSpecifier a
forall a x. CStorageSpecifier a -> Rep (CStorageSpecifier a) x
$cto :: forall a x. Rep (CStorageSpecifier a) x -> CStorageSpecifier a
$cfrom :: forall a x. CStorageSpecifier a -> Rep (CStorageSpecifier a) x
Generic, forall a. Rep1 CStorageSpecifier a -> CStorageSpecifier a
forall a. CStorageSpecifier a -> Rep1 CStorageSpecifier a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CStorageSpecifier a -> CStorageSpecifier a
$cfrom1 :: forall a. CStorageSpecifier a -> Rep1 CStorageSpecifier a
Generic1 {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CStorageSpecifier a)

-- | C type specifier (K&R A8.2, C99 6.7.2)
--
-- Type specifiers are either basic types such as @char@ or @int@,
-- @struct@, @union@ or @enum@ specifiers or typedef names.
--
-- As a GNU extension, a @typeof@ expression also is a type specifier.
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
  | CInt128Type  a
  | CUInt128Type a
  | CFloatNType Int Bool a           -- ^ IEC 60227: width (32,64,128), extended flag
  | CSUType      (CStructureUnion a) a      -- ^ Struct or Union specifier
  | CEnumType    (CEnumeration a)    a      -- ^ Enumeration specifier
  | CTypeDef     Ident        a      -- ^ Typedef name
  | CTypeOfExpr  (CExpression a)  a  -- ^ @typeof(expr)@
  | CTypeOfType  (CDeclaration a) a  -- ^ @typeof(type)@
  | CAtomicType  (CDeclaration a) a  -- ^ @_Atomic(type)@
    deriving (Int -> CTypeSpecifier a -> ShowS
forall a. Show a => Int -> CTypeSpecifier a -> ShowS
forall a. Show a => [CTypeSpecifier a] -> ShowS
forall a. Show a => CTypeSpecifier a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CTypeSpecifier a] -> ShowS
$cshowList :: forall a. Show a => [CTypeSpecifier a] -> ShowS
show :: CTypeSpecifier a -> String
$cshow :: forall a. Show a => CTypeSpecifier a -> String
showsPrec :: Int -> CTypeSpecifier a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CTypeSpecifier a -> ShowS
Show, CTypeSpecifier a -> DataType
CTypeSpecifier a -> Constr
forall {a}. Data a => Typeable (CTypeSpecifier a)
forall a. Data a => CTypeSpecifier a -> DataType
forall a. Data a => CTypeSpecifier a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> CTypeSpecifier a -> CTypeSpecifier a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CTypeSpecifier a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CTypeSpecifier a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CTypeSpecifier a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CTypeSpecifier a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CTypeSpecifier a -> m (CTypeSpecifier a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CTypeSpecifier a -> m (CTypeSpecifier a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CTypeSpecifier a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CTypeSpecifier a -> c (CTypeSpecifier a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CTypeSpecifier a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CTypeSpecifier a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CTypeSpecifier a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CTypeSpecifier a -> c (CTypeSpecifier a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CTypeSpecifier a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CTypeSpecifier a -> m (CTypeSpecifier a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CTypeSpecifier a -> m (CTypeSpecifier a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CTypeSpecifier a -> m (CTypeSpecifier a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CTypeSpecifier a -> m (CTypeSpecifier a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CTypeSpecifier a -> m (CTypeSpecifier a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CTypeSpecifier a -> m (CTypeSpecifier a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CTypeSpecifier a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CTypeSpecifier a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CTypeSpecifier a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CTypeSpecifier a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CTypeSpecifier a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CTypeSpecifier a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CTypeSpecifier a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CTypeSpecifier a -> r
gmapT :: (forall b. Data b => b -> b)
-> CTypeSpecifier a -> CTypeSpecifier a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> CTypeSpecifier a -> CTypeSpecifier a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CTypeSpecifier a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CTypeSpecifier a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CTypeSpecifier a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CTypeSpecifier a))
dataTypeOf :: CTypeSpecifier a -> DataType
$cdataTypeOf :: forall a. Data a => CTypeSpecifier a -> DataType
toConstr :: CTypeSpecifier a -> Constr
$ctoConstr :: forall a. Data a => CTypeSpecifier a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CTypeSpecifier a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CTypeSpecifier a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CTypeSpecifier a -> c (CTypeSpecifier a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CTypeSpecifier a -> c (CTypeSpecifier a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CTypeSpecifier a) x -> CTypeSpecifier a
forall a x. CTypeSpecifier a -> Rep (CTypeSpecifier a) x
$cto :: forall a x. Rep (CTypeSpecifier a) x -> CTypeSpecifier a
$cfrom :: forall a x. CTypeSpecifier a -> Rep (CTypeSpecifier a) x
Generic, forall a. Rep1 CTypeSpecifier a -> CTypeSpecifier a
forall a. CTypeSpecifier a -> Rep1 CTypeSpecifier a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CTypeSpecifier a -> CTypeSpecifier a
$cfrom1 :: forall a. CTypeSpecifier a -> Rep1 CTypeSpecifier a
Generic1 {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CTypeSpecifier a)

-- | returns @True@ if the given typespec is a struct, union or enum /definition/
isSUEDef :: CTypeSpecifier a -> Bool
isSUEDef :: forall a. CTypeSpecifier a -> Bool
isSUEDef (CSUType (CStruct CStructTag
_ Maybe Ident
_ (Just [CDeclaration a]
_) [CAttribute a]
_ a
_) a
_) = Bool
True
isSUEDef (CEnumType (CEnum Maybe Ident
_ (Just [(Ident, Maybe (CExpression a))]
_) [CAttribute a]
_ a
_) a
_) = Bool
True
isSUEDef CTypeSpecifier a
_ = Bool
False

-- | C type qualifiers (K&R A8.2, C99 6.7.3) and attributes.
--
-- @const@, @volatile@ and @restrict@ type qualifiers
-- Additionally, @__attribute__@ annotations for declarations and declarators, and
-- function specifiers
type CTypeQual = CTypeQualifier NodeInfo
data CTypeQualifier a
  = CConstQual a
  | CVolatQual a
  | CRestrQual a
  | CAtomicQual a
  | CAttrQual  (CAttribute a)
  | CNullableQual a
  | CNonnullQual a
  | CClRdOnlyQual a
  | CClWrOnlyQual a
    deriving (Int -> CTypeQualifier a -> ShowS
forall a. Show a => Int -> CTypeQualifier a -> ShowS
forall a. Show a => [CTypeQualifier a] -> ShowS
forall a. Show a => CTypeQualifier a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CTypeQualifier a] -> ShowS
$cshowList :: forall a. Show a => [CTypeQualifier a] -> ShowS
show :: CTypeQualifier a -> String
$cshow :: forall a. Show a => CTypeQualifier a -> String
showsPrec :: Int -> CTypeQualifier a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CTypeQualifier a -> ShowS
Show, CTypeQualifier a -> DataType
CTypeQualifier a -> Constr
forall {a}. Data a => Typeable (CTypeQualifier a)
forall a. Data a => CTypeQualifier a -> DataType
forall a. Data a => CTypeQualifier a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> CTypeQualifier a -> CTypeQualifier a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CTypeQualifier a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CTypeQualifier a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CTypeQualifier a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CTypeQualifier a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CTypeQualifier a -> m (CTypeQualifier a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CTypeQualifier a -> m (CTypeQualifier a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CTypeQualifier a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CTypeQualifier a -> c (CTypeQualifier a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CTypeQualifier a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CTypeQualifier a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CTypeQualifier a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CTypeQualifier a -> c (CTypeQualifier a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CTypeQualifier a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CTypeQualifier a -> m (CTypeQualifier a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CTypeQualifier a -> m (CTypeQualifier a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CTypeQualifier a -> m (CTypeQualifier a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CTypeQualifier a -> m (CTypeQualifier a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CTypeQualifier a -> m (CTypeQualifier a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CTypeQualifier a -> m (CTypeQualifier a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CTypeQualifier a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CTypeQualifier a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CTypeQualifier a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CTypeQualifier a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CTypeQualifier a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CTypeQualifier a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CTypeQualifier a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CTypeQualifier a -> r
gmapT :: (forall b. Data b => b -> b)
-> CTypeQualifier a -> CTypeQualifier a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> CTypeQualifier a -> CTypeQualifier a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CTypeQualifier a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CTypeQualifier a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CTypeQualifier a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CTypeQualifier a))
dataTypeOf :: CTypeQualifier a -> DataType
$cdataTypeOf :: forall a. Data a => CTypeQualifier a -> DataType
toConstr :: CTypeQualifier a -> Constr
$ctoConstr :: forall a. Data a => CTypeQualifier a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CTypeQualifier a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CTypeQualifier a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CTypeQualifier a -> c (CTypeQualifier a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CTypeQualifier a -> c (CTypeQualifier a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CTypeQualifier a) x -> CTypeQualifier a
forall a x. CTypeQualifier a -> Rep (CTypeQualifier a) x
$cto :: forall a x. Rep (CTypeQualifier a) x -> CTypeQualifier a
$cfrom :: forall a x. CTypeQualifier a -> Rep (CTypeQualifier a) x
Generic, forall a. Rep1 CTypeQualifier a -> CTypeQualifier a
forall a. CTypeQualifier a -> Rep1 CTypeQualifier a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CTypeQualifier a -> CTypeQualifier a
$cfrom1 :: forall a. CTypeQualifier a -> Rep1 CTypeQualifier a
Generic1 {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CTypeQualifier a)

-- | C function specifiers (C99 6.7.4)
--
-- function specifiers @inline@ and @_Noreturn@
type CFunSpec = CFunctionSpecifier NodeInfo
data CFunctionSpecifier a
  = CInlineQual a
  | CNoreturnQual a
    deriving (Int -> CFunctionSpecifier a -> ShowS
forall a. Show a => Int -> CFunctionSpecifier a -> ShowS
forall a. Show a => [CFunctionSpecifier a] -> ShowS
forall a. Show a => CFunctionSpecifier a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CFunctionSpecifier a] -> ShowS
$cshowList :: forall a. Show a => [CFunctionSpecifier a] -> ShowS
show :: CFunctionSpecifier a -> String
$cshow :: forall a. Show a => CFunctionSpecifier a -> String
showsPrec :: Int -> CFunctionSpecifier a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CFunctionSpecifier a -> ShowS
Show, CFunctionSpecifier a -> DataType
CFunctionSpecifier a -> Constr
forall {a}. Data a => Typeable (CFunctionSpecifier a)
forall a. Data a => CFunctionSpecifier a -> DataType
forall a. Data a => CFunctionSpecifier a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> CFunctionSpecifier a -> CFunctionSpecifier a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CFunctionSpecifier a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CFunctionSpecifier a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CFunctionSpecifier a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CFunctionSpecifier a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CFunctionSpecifier a -> m (CFunctionSpecifier a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CFunctionSpecifier a -> m (CFunctionSpecifier a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CFunctionSpecifier a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CFunctionSpecifier a
-> c (CFunctionSpecifier a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CFunctionSpecifier a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CFunctionSpecifier a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CFunctionSpecifier a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CFunctionSpecifier a
-> c (CFunctionSpecifier a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CFunctionSpecifier a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CFunctionSpecifier a -> m (CFunctionSpecifier a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CFunctionSpecifier a -> m (CFunctionSpecifier a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CFunctionSpecifier a -> m (CFunctionSpecifier a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CFunctionSpecifier a -> m (CFunctionSpecifier a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CFunctionSpecifier a -> m (CFunctionSpecifier a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CFunctionSpecifier a -> m (CFunctionSpecifier a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CFunctionSpecifier a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CFunctionSpecifier a -> u
gmapQ :: forall u.
(forall d. Data d => d -> u) -> CFunctionSpecifier a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CFunctionSpecifier a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CFunctionSpecifier a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CFunctionSpecifier a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CFunctionSpecifier a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CFunctionSpecifier a -> r
gmapT :: (forall b. Data b => b -> b)
-> CFunctionSpecifier a -> CFunctionSpecifier a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> CFunctionSpecifier a -> CFunctionSpecifier a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CFunctionSpecifier a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CFunctionSpecifier a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CFunctionSpecifier a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CFunctionSpecifier a))
dataTypeOf :: CFunctionSpecifier a -> DataType
$cdataTypeOf :: forall a. Data a => CFunctionSpecifier a -> DataType
toConstr :: CFunctionSpecifier a -> Constr
$ctoConstr :: forall a. Data a => CFunctionSpecifier a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CFunctionSpecifier a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CFunctionSpecifier a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CFunctionSpecifier a
-> c (CFunctionSpecifier a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CFunctionSpecifier a
-> c (CFunctionSpecifier a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CFunctionSpecifier a) x -> CFunctionSpecifier a
forall a x. CFunctionSpecifier a -> Rep (CFunctionSpecifier a) x
$cto :: forall a x. Rep (CFunctionSpecifier a) x -> CFunctionSpecifier a
$cfrom :: forall a x. CFunctionSpecifier a -> Rep (CFunctionSpecifier a) x
Generic, forall a. Rep1 CFunctionSpecifier a -> CFunctionSpecifier a
forall a. CFunctionSpecifier a -> Rep1 CFunctionSpecifier a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CFunctionSpecifier a -> CFunctionSpecifier a
$cfrom1 :: forall a. CFunctionSpecifier a -> Rep1 CFunctionSpecifier a
Generic1 {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CFunctionSpecifier a)

-- | C alignment specifiers (C99 6.7.5)
--
type CAlignSpec = CAlignmentSpecifier NodeInfo
data CAlignmentSpecifier a
  = CAlignAsType (CDeclaration a) a  -- ^ @_Alignas(type)@
  | CAlignAsExpr (CExpression a) a   -- ^ @_Alignas(expr)@
    deriving (Int -> CAlignmentSpecifier a -> ShowS
forall a. Show a => Int -> CAlignmentSpecifier a -> ShowS
forall a. Show a => [CAlignmentSpecifier a] -> ShowS
forall a. Show a => CAlignmentSpecifier a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CAlignmentSpecifier a] -> ShowS
$cshowList :: forall a. Show a => [CAlignmentSpecifier a] -> ShowS
show :: CAlignmentSpecifier a -> String
$cshow :: forall a. Show a => CAlignmentSpecifier a -> String
showsPrec :: Int -> CAlignmentSpecifier a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CAlignmentSpecifier a -> ShowS
Show, CAlignmentSpecifier a -> DataType
CAlignmentSpecifier a -> Constr
forall {a}. Data a => Typeable (CAlignmentSpecifier a)
forall a. Data a => CAlignmentSpecifier a -> DataType
forall a. Data a => CAlignmentSpecifier a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> CAlignmentSpecifier a -> CAlignmentSpecifier a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CAlignmentSpecifier a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CAlignmentSpecifier a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CAlignmentSpecifier a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CAlignmentSpecifier a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CAlignmentSpecifier a -> m (CAlignmentSpecifier a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CAlignmentSpecifier a -> m (CAlignmentSpecifier a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAlignmentSpecifier a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CAlignmentSpecifier a
-> c (CAlignmentSpecifier a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CAlignmentSpecifier a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CAlignmentSpecifier a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAlignmentSpecifier a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CAlignmentSpecifier a
-> c (CAlignmentSpecifier a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CAlignmentSpecifier a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CAlignmentSpecifier a -> m (CAlignmentSpecifier a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CAlignmentSpecifier a -> m (CAlignmentSpecifier a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CAlignmentSpecifier a -> m (CAlignmentSpecifier a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CAlignmentSpecifier a -> m (CAlignmentSpecifier a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CAlignmentSpecifier a -> m (CAlignmentSpecifier a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CAlignmentSpecifier a -> m (CAlignmentSpecifier a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CAlignmentSpecifier a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CAlignmentSpecifier a -> u
gmapQ :: forall u.
(forall d. Data d => d -> u) -> CAlignmentSpecifier a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CAlignmentSpecifier a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CAlignmentSpecifier a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CAlignmentSpecifier a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CAlignmentSpecifier a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CAlignmentSpecifier a -> r
gmapT :: (forall b. Data b => b -> b)
-> CAlignmentSpecifier a -> CAlignmentSpecifier a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> CAlignmentSpecifier a -> CAlignmentSpecifier a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CAlignmentSpecifier a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CAlignmentSpecifier a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CAlignmentSpecifier a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CAlignmentSpecifier a))
dataTypeOf :: CAlignmentSpecifier a -> DataType
$cdataTypeOf :: forall a. Data a => CAlignmentSpecifier a -> DataType
toConstr :: CAlignmentSpecifier a -> Constr
$ctoConstr :: forall a. Data a => CAlignmentSpecifier a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAlignmentSpecifier a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAlignmentSpecifier a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CAlignmentSpecifier a
-> c (CAlignmentSpecifier a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CAlignmentSpecifier a
-> c (CAlignmentSpecifier a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CAlignmentSpecifier a) x -> CAlignmentSpecifier a
forall a x. CAlignmentSpecifier a -> Rep (CAlignmentSpecifier a) x
$cto :: forall a x. Rep (CAlignmentSpecifier a) x -> CAlignmentSpecifier a
$cfrom :: forall a x. CAlignmentSpecifier a -> Rep (CAlignmentSpecifier a) x
Generic, forall a. Rep1 CAlignmentSpecifier a -> CAlignmentSpecifier a
forall a. CAlignmentSpecifier a -> Rep1 CAlignmentSpecifier a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CAlignmentSpecifier a -> CAlignmentSpecifier a
$cfrom1 :: forall a. CAlignmentSpecifier a -> Rep1 CAlignmentSpecifier a
Generic1 {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CAlignmentSpecifier a)

-- | C structure or union specifiers (K&R A8.3, C99 6.7.2.1)
--
-- @CStruct tag identifier struct-decls c-attrs@ represents a struct or union specifier (depending on @tag@).
--
--   * either @identifier@ or the declaration list @struct-decls@ (or both) have to be present.
--
--     Example: in @struct foo x;@, the identifier is present, in @struct { int y; } x@ the declaration list, and
--     in @struct foo { int y; } x;@ both of them.
--
--   * @c-attrs@ is a list of @__attribute__@ annotations associated with the struct or union specifier
type CStructUnion = CStructureUnion NodeInfo
data CStructureUnion a
  = CStruct
    CStructTag
    (Maybe Ident)
    (Maybe [CDeclaration a])  -- member declarations
    [CAttribute a]            -- __attribute__s
    a
    deriving (Int -> CStructureUnion a -> ShowS
forall a. Show a => Int -> CStructureUnion a -> ShowS
forall a. Show a => [CStructureUnion a] -> ShowS
forall a. Show a => CStructureUnion a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CStructureUnion a] -> ShowS
$cshowList :: forall a. Show a => [CStructureUnion a] -> ShowS
show :: CStructureUnion a -> String
$cshow :: forall a. Show a => CStructureUnion a -> String
showsPrec :: Int -> CStructureUnion a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CStructureUnion a -> ShowS
Show, CStructureUnion a -> DataType
CStructureUnion a -> Constr
forall {a}. Data a => Typeable (CStructureUnion a)
forall a. Data a => CStructureUnion a -> DataType
forall a. Data a => CStructureUnion a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> CStructureUnion a -> CStructureUnion a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CStructureUnion a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CStructureUnion a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CStructureUnion a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CStructureUnion a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CStructureUnion a -> m (CStructureUnion a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CStructureUnion a -> m (CStructureUnion a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStructureUnion a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CStructureUnion a
-> c (CStructureUnion a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CStructureUnion a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CStructureUnion a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStructureUnion a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CStructureUnion a
-> c (CStructureUnion a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CStructureUnion a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CStructureUnion a -> m (CStructureUnion a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CStructureUnion a -> m (CStructureUnion a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CStructureUnion a -> m (CStructureUnion a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CStructureUnion a -> m (CStructureUnion a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CStructureUnion a -> m (CStructureUnion a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CStructureUnion a -> m (CStructureUnion a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CStructureUnion a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CStructureUnion a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CStructureUnion a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CStructureUnion a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CStructureUnion a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CStructureUnion a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CStructureUnion a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CStructureUnion a -> r
gmapT :: (forall b. Data b => b -> b)
-> CStructureUnion a -> CStructureUnion a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> CStructureUnion a -> CStructureUnion a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CStructureUnion a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CStructureUnion a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CStructureUnion a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CStructureUnion a))
dataTypeOf :: CStructureUnion a -> DataType
$cdataTypeOf :: forall a. Data a => CStructureUnion a -> DataType
toConstr :: CStructureUnion a -> Constr
$ctoConstr :: forall a. Data a => CStructureUnion a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStructureUnion a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStructureUnion a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CStructureUnion a
-> c (CStructureUnion a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CStructureUnion a
-> c (CStructureUnion a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CStructureUnion a) x -> CStructureUnion a
forall a x. CStructureUnion a -> Rep (CStructureUnion a) x
$cto :: forall a x. Rep (CStructureUnion a) x -> CStructureUnion a
$cfrom :: forall a x. CStructureUnion a -> Rep (CStructureUnion a) x
Generic, forall a. Rep1 CStructureUnion a -> CStructureUnion a
forall a. CStructureUnion a -> Rep1 CStructureUnion a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CStructureUnion a -> CStructureUnion a
$cfrom1 :: forall a. CStructureUnion a -> Rep1 CStructureUnion a
Generic1 {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CStructureUnion a)

-- | A tag to determine wheter we refer to a @struct@ or @union@, see 'CStructUnion'.
data CStructTag = CStructTag
                | CUnionTag
                deriving (Int -> CStructTag -> ShowS
[CStructTag] -> ShowS
CStructTag -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CStructTag] -> ShowS
$cshowList :: [CStructTag] -> ShowS
show :: CStructTag -> String
$cshow :: CStructTag -> String
showsPrec :: Int -> CStructTag -> ShowS
$cshowsPrec :: Int -> CStructTag -> ShowS
Show, CStructTag -> CStructTag -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CStructTag -> CStructTag -> Bool
$c/= :: CStructTag -> CStructTag -> Bool
== :: CStructTag -> CStructTag -> Bool
$c== :: CStructTag -> CStructTag -> Bool
Eq,Typeable CStructTag
CStructTag -> DataType
CStructTag -> Constr
(forall b. Data b => b -> b) -> CStructTag -> CStructTag
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> CStructTag -> u
forall u. (forall d. Data d => d -> u) -> CStructTag -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CStructTag -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CStructTag -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CStructTag -> m CStructTag
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CStructTag -> m CStructTag
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CStructTag
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CStructTag -> c CStructTag
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CStructTag)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CStructTag)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CStructTag -> m CStructTag
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CStructTag -> m CStructTag
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CStructTag -> m CStructTag
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CStructTag -> m CStructTag
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CStructTag -> m CStructTag
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CStructTag -> m CStructTag
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CStructTag -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CStructTag -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CStructTag -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> CStructTag -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CStructTag -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CStructTag -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CStructTag -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CStructTag -> r
gmapT :: (forall b. Data b => b -> b) -> CStructTag -> CStructTag
$cgmapT :: (forall b. Data b => b -> b) -> CStructTag -> CStructTag
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CStructTag)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CStructTag)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CStructTag)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CStructTag)
dataTypeOf :: CStructTag -> DataType
$cdataTypeOf :: CStructTag -> DataType
toConstr :: CStructTag -> Constr
$ctoConstr :: CStructTag -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CStructTag
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CStructTag
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CStructTag -> c CStructTag
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CStructTag -> c CStructTag
Data,Typeable, forall x. Rep CStructTag x -> CStructTag
forall x. CStructTag -> Rep CStructTag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CStructTag x -> CStructTag
$cfrom :: forall x. CStructTag -> Rep CStructTag x
Generic)

instance NFData CStructTag

-- | C enumeration specifier (K&R A8.4, C99 6.7.2.2)
--
-- @CEnum identifier enumerator-list attrs@ represent as enum specifier
--
--  * Either the identifier or the enumerator-list (or both) have to be present.
--
--  * If @enumerator-list@ is present, it has to be non-empty.
--
--  * The enumerator list is of the form @(enumeration-constant, enumeration-value?)@, where the latter
--    is an optional constant integral expression.
--
--  * @attrs@ is a list of @__attribute__@ annotations associated with the enumeration specifier
type CEnum = CEnumeration NodeInfo
data CEnumeration a
  = CEnum
    (Maybe Ident)
    (Maybe [(Ident,                   -- variant name
             Maybe (CExpression a))]) -- explicit variant value
    [CAttribute a]                    -- __attribute__s
    a
    deriving (Int -> CEnumeration a -> ShowS
forall a. Show a => Int -> CEnumeration a -> ShowS
forall a. Show a => [CEnumeration a] -> ShowS
forall a. Show a => CEnumeration a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CEnumeration a] -> ShowS
$cshowList :: forall a. Show a => [CEnumeration a] -> ShowS
show :: CEnumeration a -> String
$cshow :: forall a. Show a => CEnumeration a -> String
showsPrec :: Int -> CEnumeration a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CEnumeration a -> ShowS
Show, CEnumeration a -> DataType
CEnumeration a -> Constr
forall {a}. Data a => Typeable (CEnumeration a)
forall a. Data a => CEnumeration a -> DataType
forall a. Data a => CEnumeration a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> CEnumeration a -> CEnumeration a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CEnumeration a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CEnumeration a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CEnumeration a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CEnumeration a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CEnumeration a -> m (CEnumeration a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CEnumeration a -> m (CEnumeration a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CEnumeration a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CEnumeration a -> c (CEnumeration a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CEnumeration a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CEnumeration a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CEnumeration a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CEnumeration a -> c (CEnumeration a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CEnumeration a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CEnumeration a -> m (CEnumeration a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CEnumeration a -> m (CEnumeration a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CEnumeration a -> m (CEnumeration a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CEnumeration a -> m (CEnumeration a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CEnumeration a -> m (CEnumeration a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CEnumeration a -> m (CEnumeration a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CEnumeration a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CEnumeration a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CEnumeration a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CEnumeration a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CEnumeration a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CEnumeration a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CEnumeration a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CEnumeration a -> r
gmapT :: (forall b. Data b => b -> b) -> CEnumeration a -> CEnumeration a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> CEnumeration a -> CEnumeration a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CEnumeration a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CEnumeration a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CEnumeration a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CEnumeration a))
dataTypeOf :: CEnumeration a -> DataType
$cdataTypeOf :: forall a. Data a => CEnumeration a -> DataType
toConstr :: CEnumeration a -> Constr
$ctoConstr :: forall a. Data a => CEnumeration a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CEnumeration a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CEnumeration a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CEnumeration a -> c (CEnumeration a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CEnumeration a -> c (CEnumeration a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CEnumeration a) x -> CEnumeration a
forall a x. CEnumeration a -> Rep (CEnumeration a) x
$cto :: forall a x. Rep (CEnumeration a) x -> CEnumeration a
$cfrom :: forall a x. CEnumeration a -> Rep (CEnumeration a) x
Generic, forall a. Rep1 CEnumeration a -> CEnumeration a
forall a. CEnumeration a -> Rep1 CEnumeration a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CEnumeration a -> CEnumeration a
$cfrom1 :: forall a. CEnumeration a -> Rep1 CEnumeration a
Generic1 {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CEnumeration a)

-- | C initialization (K&R A8.7, C99 6.7.8)
--
-- Initializers are either assignment expressions or initializer lists
-- (surrounded in curly braces), whose elements are themselves
-- initializers, paired with an optional list of designators.
type CInit = CInitializer NodeInfo
data CInitializer a
  -- | assignment expression
  = CInitExpr (CExpression a) a
  -- | initialization list (see 'CInitList')
  | CInitList (CInitializerList a) a
    deriving (Int -> CInitializer a -> ShowS
forall a. Show a => Int -> CInitializer a -> ShowS
forall a. Show a => [CInitializer a] -> ShowS
forall a. Show a => CInitializer a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CInitializer a] -> ShowS
$cshowList :: forall a. Show a => [CInitializer a] -> ShowS
show :: CInitializer a -> String
$cshow :: forall a. Show a => CInitializer a -> String
showsPrec :: Int -> CInitializer a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CInitializer a -> ShowS
Show, CInitializer a -> DataType
CInitializer a -> Constr
forall {a}. Data a => Typeable (CInitializer a)
forall a. Data a => CInitializer a -> DataType
forall a. Data a => CInitializer a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> CInitializer a -> CInitializer a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CInitializer a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CInitializer a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CInitializer a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CInitializer a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CInitializer a -> m (CInitializer a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CInitializer a -> m (CInitializer a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CInitializer a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CInitializer a -> c (CInitializer a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CInitializer a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CInitializer a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CInitializer a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CInitializer a -> c (CInitializer a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CInitializer a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CInitializer a -> m (CInitializer a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CInitializer a -> m (CInitializer a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CInitializer a -> m (CInitializer a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CInitializer a -> m (CInitializer a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CInitializer a -> m (CInitializer a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CInitializer a -> m (CInitializer a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CInitializer a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CInitializer a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CInitializer a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CInitializer a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CInitializer a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CInitializer a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CInitializer a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CInitializer a -> r
gmapT :: (forall b. Data b => b -> b) -> CInitializer a -> CInitializer a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> CInitializer a -> CInitializer a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CInitializer a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CInitializer a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CInitializer a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CInitializer a))
dataTypeOf :: CInitializer a -> DataType
$cdataTypeOf :: forall a. Data a => CInitializer a -> DataType
toConstr :: CInitializer a -> Constr
$ctoConstr :: forall a. Data a => CInitializer a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CInitializer a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CInitializer a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CInitializer a -> c (CInitializer a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CInitializer a -> c (CInitializer a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CInitializer a) x -> CInitializer a
forall a x. CInitializer a -> Rep (CInitializer a) x
$cto :: forall a x. Rep (CInitializer a) x -> CInitializer a
$cfrom :: forall a x. CInitializer a -> Rep (CInitializer a) x
Generic {-! ,CNode , Annotated !-})

instance NFData a => NFData (CInitializer a)

-- deriving Functor does not work (type synonym)
instance Functor CInitializer where
        fmap :: forall a b. (a -> b) -> CInitializer a -> CInitializer b
fmap a -> b
_f (CInitExpr CExpression a
a1 a
a2) = forall a. CExpression a -> a -> CInitializer a
CInitExpr (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CInitList CInitializerList a
a1 a
a2) = forall a. CInitializerList a -> a -> CInitializer a
CInitList (forall a b. (a -> b) -> CInitializerList a -> CInitializerList b
fmapInitList a -> b
_f CInitializerList a
a1) (a -> b
_f a
a2)
fmapInitList :: (a->b) -> (CInitializerList a) -> (CInitializerList b)
fmapInitList :: forall a b. (a -> b) -> CInitializerList a -> CInitializerList b
fmapInitList a -> b
_f = forall a b. (a -> b) -> [a] -> [b]
map (\([CPartDesignator a]
desigs, CInitializer a
initializer) -> (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CPartDesignator a]
desigs, forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CInitializer a
initializer))

-- | Initializer List
--
-- The members of an initializer list are of the form @(designator-list,initializer)@.
-- The @designator-list@ specifies one member of the compound type which is initialized.
-- It is allowed to be empty - in this case the initializer refers to the
-- ''next'' member of the compound type (see C99 6.7.8).
--
-- Examples (simplified expressions and identifiers):
--
-- > -- int x[3][4] = { [0][3] = 4, [2] = 5, 8 };
-- > --   corresponds to the assignments
-- > -- x[0][3] = 4; x[2][0] = 5; x[2][1] = 8;
-- > let init1 = ([CArrDesig 0, CArrDesig 3], CInitExpr 4)
-- >     init2 = ([CArrDesig 2]             , CInitExpr 5)
-- >     init3 = ([]                        , CInitExpr 8)
-- > in  CInitList [init1, init2, init3]
--
-- > -- struct { struct { int a[2]; int b[2]; int c[2]; } s; } x = { .s = { {2,3} , .c[0] = 1 } };
-- > --   corresponds to the assignments
-- > -- x.s.a[0] = 2; x.s.a[1] = 3; x.s.c[0] = 1;
-- > let init_s_0 = CInitList [ ([], CInitExpr 2), ([], CInitExpr 3)]
-- >     init_s   = CInitList [
-- >                            ([], init_s_0),
-- >                            ([CMemberDesig "c", CArrDesig 0], CInitExpr 1)
-- >                          ]
-- > in  CInitList [(CMemberDesig "s", init_s)]
type CInitList = CInitializerList NodeInfo
type CInitializerList a = [([CPartDesignator a], CInitializer a)]

-- | Designators
--
-- A designator specifies a member of an object, either an element or range of an array,
-- or the named member of a struct \/ union.
type CDesignator = CPartDesignator NodeInfo
data CPartDesignator a
  -- | array position designator
  = CArrDesig     (CExpression a) a
  -- | member designator
  | CMemberDesig  Ident a
  -- | array range designator @CRangeDesig from to _@ (GNU C)
  | CRangeDesig (CExpression a) (CExpression a) a
    deriving (Int -> CPartDesignator a -> ShowS
forall a. Show a => Int -> CPartDesignator a -> ShowS
forall a. Show a => [CPartDesignator a] -> ShowS
forall a. Show a => CPartDesignator a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CPartDesignator a] -> ShowS
$cshowList :: forall a. Show a => [CPartDesignator a] -> ShowS
show :: CPartDesignator a -> String
$cshow :: forall a. Show a => CPartDesignator a -> String
showsPrec :: Int -> CPartDesignator a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CPartDesignator a -> ShowS
Show, CPartDesignator a -> DataType
CPartDesignator a -> Constr
forall {a}. Data a => Typeable (CPartDesignator a)
forall a. Data a => CPartDesignator a -> DataType
forall a. Data a => CPartDesignator a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> CPartDesignator a -> CPartDesignator a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CPartDesignator a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CPartDesignator a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CPartDesignator a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CPartDesignator a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CPartDesignator a -> m (CPartDesignator a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CPartDesignator a -> m (CPartDesignator a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CPartDesignator a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CPartDesignator a
-> c (CPartDesignator a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CPartDesignator a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CPartDesignator a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CPartDesignator a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CPartDesignator a
-> c (CPartDesignator a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CPartDesignator a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CPartDesignator a -> m (CPartDesignator a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CPartDesignator a -> m (CPartDesignator a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CPartDesignator a -> m (CPartDesignator a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CPartDesignator a -> m (CPartDesignator a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CPartDesignator a -> m (CPartDesignator a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CPartDesignator a -> m (CPartDesignator a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CPartDesignator a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CPartDesignator a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CPartDesignator a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CPartDesignator a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CPartDesignator a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CPartDesignator a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CPartDesignator a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CPartDesignator a -> r
gmapT :: (forall b. Data b => b -> b)
-> CPartDesignator a -> CPartDesignator a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> CPartDesignator a -> CPartDesignator a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CPartDesignator a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CPartDesignator a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CPartDesignator a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CPartDesignator a))
dataTypeOf :: CPartDesignator a -> DataType
$cdataTypeOf :: forall a. Data a => CPartDesignator a -> DataType
toConstr :: CPartDesignator a -> Constr
$ctoConstr :: forall a. Data a => CPartDesignator a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CPartDesignator a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CPartDesignator a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CPartDesignator a
-> c (CPartDesignator a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CPartDesignator a
-> c (CPartDesignator a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CPartDesignator a) x -> CPartDesignator a
forall a x. CPartDesignator a -> Rep (CPartDesignator a) x
$cto :: forall a x. Rep (CPartDesignator a) x -> CPartDesignator a
$cfrom :: forall a x. CPartDesignator a -> Rep (CPartDesignator a) x
Generic {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CPartDesignator a)

-- | @__attribute__@ annotations
--
-- Those are of the form @CAttr attribute-name attribute-parameters@,
-- and serve as generic properties of some syntax tree elements.
type CAttr = CAttribute NodeInfo
data CAttribute a = CAttr Ident [CExpression a] a
                    deriving (Int -> CAttribute a -> ShowS
forall a. Show a => Int -> CAttribute a -> ShowS
forall a. Show a => [CAttribute a] -> ShowS
forall a. Show a => CAttribute a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CAttribute a] -> ShowS
$cshowList :: forall a. Show a => [CAttribute a] -> ShowS
show :: CAttribute a -> String
$cshow :: forall a. Show a => CAttribute a -> String
showsPrec :: Int -> CAttribute a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CAttribute a -> ShowS
Show, CAttribute a -> DataType
CAttribute a -> Constr
forall {a}. Data a => Typeable (CAttribute a)
forall a. Data a => CAttribute a -> DataType
forall a. Data a => CAttribute a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> CAttribute a -> CAttribute a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CAttribute a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CAttribute a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CAttribute a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CAttribute a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> CAttribute a -> m (CAttribute a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> CAttribute a -> m (CAttribute a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAttribute a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CAttribute a -> c (CAttribute a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CAttribute a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CAttribute a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAttribute a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CAttribute a -> c (CAttribute a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CAttribute a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CAttribute a -> m (CAttribute a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> CAttribute a -> m (CAttribute a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CAttribute a -> m (CAttribute a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> CAttribute a -> m (CAttribute a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CAttribute a -> m (CAttribute a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> CAttribute a -> m (CAttribute a)
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CAttribute a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CAttribute a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CAttribute a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CAttribute a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CAttribute a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CAttribute a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CAttribute a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CAttribute a -> r
gmapT :: (forall b. Data b => b -> b) -> CAttribute a -> CAttribute a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> CAttribute a -> CAttribute a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CAttribute a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CAttribute a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CAttribute a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CAttribute a))
dataTypeOf :: CAttribute a -> DataType
$cdataTypeOf :: forall a. Data a => CAttribute a -> DataType
toConstr :: CAttribute a -> Constr
$ctoConstr :: forall a. Data a => CAttribute a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAttribute a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CAttribute a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CAttribute a -> c (CAttribute a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CAttribute a -> c (CAttribute a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CAttribute a) x -> CAttribute a
forall a x. CAttribute a -> Rep (CAttribute a) x
$cto :: forall a x. Rep (CAttribute a) x -> CAttribute a
$cfrom :: forall a x. CAttribute a -> Rep (CAttribute a) x
Generic, forall a. Rep1 CAttribute a -> CAttribute a
forall a. CAttribute a -> Rep1 CAttribute a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CAttribute a -> CAttribute a
$cfrom1 :: forall a. CAttribute a -> Rep1 CAttribute a
Generic1 {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CAttribute a)

-- | C expression (K&R A7)
--
-- * these can be arbitrary expression, as the argument of `sizeof' can be
--   arbitrary, even if appearing in a constant expression
--
-- * GNU C extensions: @alignof@, @__real@, @__imag@, @({ stmt-expr })@, @&& label@ and built-ins
--
type CExpr = CExpression NodeInfo
data CExpression a
  = CComma       [CExpression a]         -- comma expression list, n >= 2
                 a
  | CAssign      CAssignOp               -- assignment operator
                 (CExpression a)         -- l-value
                 (CExpression a)         -- r-value
                 a
  | CCond        (CExpression a)         -- conditional
                 (Maybe (CExpression a)) -- true-expression (GNU allows omitting)
                 (CExpression a)         -- false-expression
                 a
  | CBinary      CBinaryOp               -- binary operator
                 (CExpression a)         -- lhs
                 (CExpression a)         -- rhs
                 a
  | CCast        (CDeclaration a)        -- type name
                 (CExpression a)
                 a
  | CUnary       CUnaryOp                -- unary operator
                 (CExpression a)
                 a
  | CSizeofExpr  (CExpression a)
                 a
  | CSizeofType  (CDeclaration a)        -- type name
                 a
  | CAlignofExpr (CExpression a)
                 a
  | CAlignofType (CDeclaration a)        -- type name
                 a
  | CComplexReal (CExpression a)         -- real part of complex number
                 a
  | CComplexImag (CExpression a)         -- imaginary part of complex number
                 a
  | CIndex       (CExpression a)         -- array
                 (CExpression a)         -- index
                 a
  | CCall        (CExpression a)         -- function
                 [CExpression a]         -- arguments
                 a
  | CMember      (CExpression a)         -- structure
                 Ident                   -- member name
                 Bool                    -- deref structure? (True for `->')
                 a
  | CVar         Ident                   -- identifier (incl. enumeration const)
                 a
  | CConst       (CConstant a)           -- ^ integer, character, floating point and string constants
  | CCompoundLit (CDeclaration a)
                 (CInitializerList a)    -- type name & initialiser list
                 a                       -- ^ C99 compound literal
  | CGenericSelection (CExpression a) [(Maybe (CDeclaration a), CExpression a)] a -- ^ C11 generic selection
  | CStatExpr    (CStatement a) a        -- ^ GNU C compound statement as expr
  | CLabAddrExpr Ident a                 -- ^ GNU C address of label
  | CBuiltinExpr (CBuiltinThing a)       -- ^ builtin expressions, see 'CBuiltin'
    deriving (CExpression a -> DataType
CExpression a -> Constr
forall {a}. Data a => Typeable (CExpression a)
forall a. Data a => CExpression a -> DataType
forall a. Data a => CExpression a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> CExpression a -> CExpression a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CExpression a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CExpression a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CExpression a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CExpression a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CExpression a -> m (CExpression a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CExpression a -> m (CExpression a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CExpression a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CExpression a -> c (CExpression a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CExpression a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CExpression a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CExpression a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CExpression a -> c (CExpression a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CExpression a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CExpression a -> m (CExpression a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CExpression a -> m (CExpression a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CExpression a -> m (CExpression a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CExpression a -> m (CExpression a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CExpression a -> m (CExpression a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CExpression a -> m (CExpression a)
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CExpression a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CExpression a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CExpression a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CExpression a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CExpression a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CExpression a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CExpression a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CExpression a -> r
gmapT :: (forall b. Data b => b -> b) -> CExpression a -> CExpression a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> CExpression a -> CExpression a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CExpression a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CExpression a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CExpression a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CExpression a))
dataTypeOf :: CExpression a -> DataType
$cdataTypeOf :: forall a. Data a => CExpression a -> DataType
toConstr :: CExpression a -> Constr
$ctoConstr :: forall a. Data a => CExpression a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CExpression a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CExpression a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CExpression a -> c (CExpression a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CExpression a -> c (CExpression a)
Data,Typeable,Int -> CExpression a -> ShowS
forall a. Show a => Int -> CExpression a -> ShowS
forall a. Show a => [CExpression a] -> ShowS
forall a. Show a => CExpression a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CExpression a] -> ShowS
$cshowList :: forall a. Show a => [CExpression a] -> ShowS
show :: CExpression a -> String
$cshow :: forall a. Show a => CExpression a -> String
showsPrec :: Int -> CExpression a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CExpression a -> ShowS
Show, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CExpression a) x -> CExpression a
forall a x. CExpression a -> Rep (CExpression a) x
$cto :: forall a x. Rep (CExpression a) x -> CExpression a
$cfrom :: forall a x. CExpression a -> Rep (CExpression a) x
Generic {-! ,CNode , Annotated !-})

instance NFData a => NFData (CExpression a)

-- deriving Functor does not work (type synonyms)
instance Functor CExpression where
        fmap :: forall a b. (a -> b) -> CExpression a -> CExpression b
fmap a -> b
_f (CComma [CExpression a]
a1 a
a2) = forall a. [CExpression a] -> a -> CExpression a
CComma (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CExpression a]
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CAssign CAssignOp
a1 CExpression a
a2 CExpression a
a3 a
a4)
          = forall a.
CAssignOp -> CExpression a -> CExpression a -> a -> CExpression a
CAssign CAssignOp
a1 (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a2) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a3) (a -> b
_f a
a4)
        fmap a -> b
_f (CCond CExpression a
a1 Maybe (CExpression a)
a2 CExpression a
a3 a
a4)
          = forall a.
CExpression a
-> Maybe (CExpression a) -> CExpression a -> a -> CExpression a
CCond (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) Maybe (CExpression a)
a2) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a3) (a -> b
_f a
a4)
        fmap a -> b
_f (CBinary CBinaryOp
a1 CExpression a
a2 CExpression a
a3 a
a4)
          = forall a.
CBinaryOp -> CExpression a -> CExpression a -> a -> CExpression a
CBinary CBinaryOp
a1 (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a2) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a3) (a -> b
_f a
a4)
        fmap a -> b
_f (CCast CDeclaration a
a1 CExpression a
a2 a
a3) = forall a. CDeclaration a -> CExpression a -> a -> CExpression a
CCast (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CDeclaration a
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a2) (a -> b
_f a
a3)
        fmap a -> b
_f (CUnary CUnaryOp
a1 CExpression a
a2 a
a3) = forall a. CUnaryOp -> CExpression a -> a -> CExpression a
CUnary CUnaryOp
a1 (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a2) (a -> b
_f a
a3)
        fmap a -> b
_f (CSizeofExpr CExpression a
a1 a
a2) = forall a. CExpression a -> a -> CExpression a
CSizeofExpr (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CSizeofType CDeclaration a
a1 a
a2) = forall a. CDeclaration a -> a -> CExpression a
CSizeofType (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CDeclaration a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CAlignofExpr CExpression a
a1 a
a2) = forall a. CExpression a -> a -> CExpression a
CAlignofExpr (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CAlignofType CDeclaration a
a1 a
a2) = forall a. CDeclaration a -> a -> CExpression a
CAlignofType (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CDeclaration a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CComplexReal CExpression a
a1 a
a2) = forall a. CExpression a -> a -> CExpression a
CComplexReal (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CComplexImag CExpression a
a1 a
a2) = forall a. CExpression a -> a -> CExpression a
CComplexImag (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CIndex CExpression a
a1 CExpression a
a2 a
a3)
          = forall a. CExpression a -> CExpression a -> a -> CExpression a
CIndex (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a2) (a -> b
_f a
a3)
        fmap a -> b
_f (CCall CExpression a
a1 [CExpression a]
a2 a
a3)
          = forall a. CExpression a -> [CExpression a] -> a -> CExpression a
CCall (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CExpression a]
a2) (a -> b
_f a
a3)
        fmap a -> b
_f (CMember CExpression a
a1 Ident
a2 Bool
a3 a
a4) = forall a. CExpression a -> Ident -> Bool -> a -> CExpression a
CMember (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) Ident
a2 Bool
a3 (a -> b
_f a
a4)
        fmap a -> b
_f (CVar Ident
a1 a
a2) = forall a. Ident -> a -> CExpression a
CVar Ident
a1 (a -> b
_f a
a2)
        fmap a -> b
_f (CConst CConstant a
a1) = forall a. CConstant a -> CExpression a
CConst (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CConstant a
a1)
        fmap a -> b
_f (CCompoundLit CDeclaration a
a1 CInitializerList a
a2 a
a3)
          = forall a.
CDeclaration a -> CInitializerList a -> a -> CExpression a
CCompoundLit (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CDeclaration a
a1) (forall a b. (a -> b) -> CInitializerList a -> CInitializerList b
fmapInitList a -> b
_f CInitializerList a
a2) (a -> b
_f a
a3)
        fmap a -> b
_f (CStatExpr CStatement a
a1 a
a2) = forall a. CStatement a -> a -> CExpression a
CStatExpr (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStatement a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CLabAddrExpr Ident
a1 a
a2) = forall a. Ident -> a -> CExpression a
CLabAddrExpr Ident
a1 (a -> b
_f a
a2)
        fmap a -> b
_f (CBuiltinExpr CBuiltinThing a
a1) = forall a. CBuiltinThing a -> CExpression a
CBuiltinExpr (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CBuiltinThing a
a1)
        fmap a -> b
_f (CGenericSelection CExpression a
expr [(Maybe (CDeclaration a), CExpression a)]
list a
annot) =
          forall a.
CExpression a
-> [(Maybe (CDeclaration a), CExpression a)] -> a -> CExpression a
CGenericSelection (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
expr) (forall a b. (a -> b) -> [a] -> [b]
map forall {f :: * -> *} {f :: * -> *} {f :: * -> *}.
(Functor f, Functor f, Functor f) =>
(f (f a), f a) -> (f (f b), f b)
fmap_helper [(Maybe (CDeclaration a), CExpression a)]
list) (a -> b
_f a
annot)
          where
            fmap_helper :: (f (f a), f a) -> (f (f b), f b)
fmap_helper (f (f a)
ma1, f a
a2) = (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) f (f a)
ma1, forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f f a
a2)

-- | GNU Builtins, which cannot be typed in C99
type CBuiltin = CBuiltinThing NodeInfo
data CBuiltinThing a
  = CBuiltinVaArg (CExpression a) (CDeclaration a) a            -- ^ @(expr, type)@
  | CBuiltinOffsetOf (CDeclaration a) [CPartDesignator a] a -- ^ @(type, designator-list)@
  | CBuiltinTypesCompatible (CDeclaration a) (CDeclaration a) a  -- ^ @(type,type)@
  | CBuiltinConvertVector (CExpression a) (CDeclaration a) a -- ^ @(expr, type)@
    deriving (Int -> CBuiltinThing a -> ShowS
forall a. Show a => Int -> CBuiltinThing a -> ShowS
forall a. Show a => [CBuiltinThing a] -> ShowS
forall a. Show a => CBuiltinThing a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CBuiltinThing a] -> ShowS
$cshowList :: forall a. Show a => [CBuiltinThing a] -> ShowS
show :: CBuiltinThing a -> String
$cshow :: forall a. Show a => CBuiltinThing a -> String
showsPrec :: Int -> CBuiltinThing a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CBuiltinThing a -> ShowS
Show, CBuiltinThing a -> DataType
CBuiltinThing a -> Constr
forall {a}. Data a => Typeable (CBuiltinThing a)
forall a. Data a => CBuiltinThing a -> DataType
forall a. Data a => CBuiltinThing a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> CBuiltinThing a -> CBuiltinThing a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CBuiltinThing a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CBuiltinThing a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CBuiltinThing a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CBuiltinThing a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CBuiltinThing a -> m (CBuiltinThing a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CBuiltinThing a -> m (CBuiltinThing a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CBuiltinThing a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CBuiltinThing a -> c (CBuiltinThing a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CBuiltinThing a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CBuiltinThing a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CBuiltinThing a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CBuiltinThing a -> c (CBuiltinThing a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CBuiltinThing a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CBuiltinThing a -> m (CBuiltinThing a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CBuiltinThing a -> m (CBuiltinThing a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CBuiltinThing a -> m (CBuiltinThing a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CBuiltinThing a -> m (CBuiltinThing a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CBuiltinThing a -> m (CBuiltinThing a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CBuiltinThing a -> m (CBuiltinThing a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CBuiltinThing a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CBuiltinThing a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CBuiltinThing a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CBuiltinThing a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CBuiltinThing a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CBuiltinThing a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CBuiltinThing a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CBuiltinThing a -> r
gmapT :: (forall b. Data b => b -> b) -> CBuiltinThing a -> CBuiltinThing a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> CBuiltinThing a -> CBuiltinThing a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CBuiltinThing a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CBuiltinThing a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CBuiltinThing a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CBuiltinThing a))
dataTypeOf :: CBuiltinThing a -> DataType
$cdataTypeOf :: forall a. Data a => CBuiltinThing a -> DataType
toConstr :: CBuiltinThing a -> Constr
$ctoConstr :: forall a. Data a => CBuiltinThing a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CBuiltinThing a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CBuiltinThing a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CBuiltinThing a -> c (CBuiltinThing a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CBuiltinThing a -> c (CBuiltinThing a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CBuiltinThing a) x -> CBuiltinThing a
forall a x. CBuiltinThing a -> Rep (CBuiltinThing a) x
$cto :: forall a x. Rep (CBuiltinThing a) x -> CBuiltinThing a
$cfrom :: forall a x. CBuiltinThing a -> Rep (CBuiltinThing a) x
Generic {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CBuiltinThing a)

-- | C constant (K&R A2.5 & A7.2)
type CConst = CConstant NodeInfo
data CConstant a
  = CIntConst   CInteger a
  | CCharConst  CChar a
  | CFloatConst CFloat a
  | CStrConst   CString a
    deriving (Int -> CConstant a -> ShowS
forall a. Show a => Int -> CConstant a -> ShowS
forall a. Show a => [CConstant a] -> ShowS
forall a. Show a => CConstant a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CConstant a] -> ShowS
$cshowList :: forall a. Show a => [CConstant a] -> ShowS
show :: CConstant a -> String
$cshow :: forall a. Show a => CConstant a -> String
showsPrec :: Int -> CConstant a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CConstant a -> ShowS
Show, CConstant a -> DataType
CConstant a -> Constr
forall {a}. Data a => Typeable (CConstant a)
forall a. Data a => CConstant a -> DataType
forall a. Data a => CConstant a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> CConstant a -> CConstant a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CConstant a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CConstant a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CConstant a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CConstant a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> CConstant a -> m (CConstant a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> CConstant a -> m (CConstant a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CConstant a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CConstant a -> c (CConstant a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CConstant a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CConstant a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CConstant a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CConstant a -> c (CConstant a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CConstant a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CConstant a -> m (CConstant a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> CConstant a -> m (CConstant a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CConstant a -> m (CConstant a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> CConstant a -> m (CConstant a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CConstant a -> m (CConstant a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> CConstant a -> m (CConstant a)
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CConstant a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CConstant a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CConstant a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CConstant a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CConstant a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CConstant a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CConstant a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CConstant a -> r
gmapT :: (forall b. Data b => b -> b) -> CConstant a -> CConstant a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> CConstant a -> CConstant a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CConstant a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CConstant a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CConstant a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CConstant a))
dataTypeOf :: CConstant a -> DataType
$cdataTypeOf :: forall a. Data a => CConstant a -> DataType
toConstr :: CConstant a -> Constr
$ctoConstr :: forall a. Data a => CConstant a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CConstant a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CConstant a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CConstant a -> c (CConstant a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CConstant a -> c (CConstant a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CConstant a) x -> CConstant a
forall a x. CConstant a -> Rep (CConstant a) x
$cto :: forall a x. Rep (CConstant a) x -> CConstant a
$cfrom :: forall a x. CConstant a -> Rep (CConstant a) x
Generic, forall a. Rep1 CConstant a -> CConstant a
forall a. CConstant a -> Rep1 CConstant a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CConstant a -> CConstant a
$cfrom1 :: forall a. CConstant a -> Rep1 CConstant a
Generic1 {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CConstant a)

-- | Attributed string literals
type CStrLit = CStringLiteral NodeInfo
data CStringLiteral a = CStrLit CString a
            deriving (Int -> CStringLiteral a -> ShowS
forall a. Show a => Int -> CStringLiteral a -> ShowS
forall a. Show a => [CStringLiteral a] -> ShowS
forall a. Show a => CStringLiteral a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CStringLiteral a] -> ShowS
$cshowList :: forall a. Show a => [CStringLiteral a] -> ShowS
show :: CStringLiteral a -> String
$cshow :: forall a. Show a => CStringLiteral a -> String
showsPrec :: Int -> CStringLiteral a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> CStringLiteral a -> ShowS
Show, CStringLiteral a -> DataType
CStringLiteral a -> Constr
forall {a}. Data a => Typeable (CStringLiteral a)
forall a. Data a => CStringLiteral a -> DataType
forall a. Data a => CStringLiteral a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> CStringLiteral a -> CStringLiteral a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CStringLiteral a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> CStringLiteral a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CStringLiteral a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CStringLiteral a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CStringLiteral a -> m (CStringLiteral a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CStringLiteral a -> m (CStringLiteral a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStringLiteral a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CStringLiteral a -> c (CStringLiteral a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CStringLiteral a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CStringLiteral a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStringLiteral a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CStringLiteral a -> c (CStringLiteral a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CStringLiteral a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CStringLiteral a -> m (CStringLiteral a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CStringLiteral a -> m (CStringLiteral a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CStringLiteral a -> m (CStringLiteral a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> CStringLiteral a -> m (CStringLiteral a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CStringLiteral a -> m (CStringLiteral a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> CStringLiteral a -> m (CStringLiteral a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CStringLiteral a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> CStringLiteral a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> CStringLiteral a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> CStringLiteral a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CStringLiteral a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CStringLiteral a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CStringLiteral a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CStringLiteral a -> r
gmapT :: (forall b. Data b => b -> b)
-> CStringLiteral a -> CStringLiteral a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> CStringLiteral a -> CStringLiteral a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CStringLiteral a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CStringLiteral a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CStringLiteral a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CStringLiteral a))
dataTypeOf :: CStringLiteral a -> DataType
$cdataTypeOf :: forall a. Data a => CStringLiteral a -> DataType
toConstr :: CStringLiteral a -> Constr
$ctoConstr :: forall a. Data a => CStringLiteral a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStringLiteral a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CStringLiteral a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CStringLiteral a -> c (CStringLiteral a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CStringLiteral a -> c (CStringLiteral a)
Data,Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (CStringLiteral a) x -> CStringLiteral a
forall a x. CStringLiteral a -> Rep (CStringLiteral a) x
$cto :: forall a x. Rep (CStringLiteral a) x -> CStringLiteral a
$cfrom :: forall a x. CStringLiteral a -> Rep (CStringLiteral a) x
Generic, forall a. Rep1 CStringLiteral a -> CStringLiteral a
forall a. CStringLiteral a -> Rep1 CStringLiteral a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 CStringLiteral a -> CStringLiteral a
$cfrom1 :: forall a. CStringLiteral a -> Rep1 CStringLiteral a
Generic1 {-! ,CNode ,Functor ,Annotated !-})

instance NFData a => NFData (CStringLiteral a)

cstringOfLit :: CStringLiteral a -> CString
cstringOfLit :: forall a. CStringLiteral a -> CString
cstringOfLit (CStrLit CString
cstr a
_) = CString
cstr

-- | Lift a string literal to a C constant
liftStrLit :: CStringLiteral a -> CConstant a
liftStrLit :: forall a. CStringLiteral a -> CConstant a
liftStrLit (CStrLit CString
str a
at) = forall a. CString -> a -> CConstant a
CStrConst CString
str a
at

-- | All AST nodes are annotated. Inspired by the Annotated
-- class of Niklas Broberg's haskell-src-exts package.
-- In principle, we could have Copointed superclass instead
-- of @ann@, for the price of another dependency.
class (Functor ast) => Annotated ast where
  -- | get the annotation of an AST node
  annotation :: ast a -> a
  -- | change the annotation (non-recursively)
  --   of an AST node. Use fmap for recursively
  --   modifying the annotation.
  amap  :: (a->a) -> ast a -> ast a

-- fmap2 :: (a->a') -> (a,b) -> (a',b)
-- fmap2 f (a,b) = (f a, b)

-- Instances generated using derive-2.*
-- GENERATED START

instance CNode t1 => CNode (CTranslationUnit t1) where
        nodeInfo :: CTranslationUnit t1 -> NodeInfo
nodeInfo (CTranslUnit [CExternalDeclaration t1]
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CTranslationUnit t1) where
        posOf :: CTranslationUnit t1 -> Position
posOf CTranslationUnit t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CTranslationUnit t1
x)

instance Functor CTranslationUnit where
        fmap :: forall a b. (a -> b) -> CTranslationUnit a -> CTranslationUnit b
fmap a -> b
_f (CTranslUnit [CExternalDeclaration a]
a1 a
a2)
          = forall a. [CExternalDeclaration a] -> a -> CTranslationUnit a
CTranslUnit (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CExternalDeclaration a]
a1) (a -> b
_f a
a2)

instance Annotated CTranslationUnit where
        annotation :: forall a. CTranslationUnit a -> a
annotation (CTranslUnit [CExternalDeclaration a]
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CTranslationUnit a -> CTranslationUnit a
amap a -> a
f (CTranslUnit [CExternalDeclaration a]
a_1 a
a_2) = forall a. [CExternalDeclaration a] -> a -> CTranslationUnit a
CTranslUnit [CExternalDeclaration a]
a_1 (a -> a
f a
a_2)

instance CNode t1 => CNode (CExternalDeclaration t1) where
        nodeInfo :: CExternalDeclaration t1 -> NodeInfo
nodeInfo (CDeclExt CDeclaration t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo CDeclaration t1
d
        nodeInfo (CFDefExt CFunctionDef t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo CFunctionDef t1
d
        nodeInfo (CAsmExt CStringLiteral t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CExternalDeclaration t1) where
        posOf :: CExternalDeclaration t1 -> Position
posOf CExternalDeclaration t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CExternalDeclaration t1
x)

instance Functor CExternalDeclaration where
        fmap :: forall a b.
(a -> b) -> CExternalDeclaration a -> CExternalDeclaration b
fmap a -> b
_f (CDeclExt CDeclaration a
a1) = forall a. CDeclaration a -> CExternalDeclaration a
CDeclExt (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CDeclaration a
a1)
        fmap a -> b
_f (CFDefExt CFunctionDef a
a1) = forall a. CFunctionDef a -> CExternalDeclaration a
CFDefExt (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CFunctionDef a
a1)
        fmap a -> b
_f (CAsmExt CStringLiteral a
a1 a
a2) = forall a. CStringLiteral a -> a -> CExternalDeclaration a
CAsmExt (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStringLiteral a
a1) (a -> b
_f a
a2)

instance Annotated CExternalDeclaration where
        annotation :: forall a. CExternalDeclaration a -> a
annotation (CDeclExt CDeclaration a
n) = forall (ast :: * -> *) a. Annotated ast => ast a -> a
annotation CDeclaration a
n
        annotation (CFDefExt CFunctionDef a
n) = forall (ast :: * -> *) a. Annotated ast => ast a -> a
annotation CFunctionDef a
n
        annotation (CAsmExt CStringLiteral a
_ a
n) = a
n
        amap :: forall a.
(a -> a) -> CExternalDeclaration a -> CExternalDeclaration a
amap a -> a
f (CDeclExt CDeclaration a
n) = forall a. CDeclaration a -> CExternalDeclaration a
CDeclExt (forall (ast :: * -> *) a.
Annotated ast =>
(a -> a) -> ast a -> ast a
amap a -> a
f CDeclaration a
n)
        amap a -> a
f (CFDefExt CFunctionDef a
n) = forall a. CFunctionDef a -> CExternalDeclaration a
CFDefExt (forall (ast :: * -> *) a.
Annotated ast =>
(a -> a) -> ast a -> ast a
amap a -> a
f CFunctionDef a
n)
        amap a -> a
f (CAsmExt CStringLiteral a
a_1 a
a_2) = forall a. CStringLiteral a -> a -> CExternalDeclaration a
CAsmExt CStringLiteral a
a_1 (a -> a
f a
a_2)

instance CNode t1 => CNode (CFunctionDef t1) where
        nodeInfo :: CFunctionDef t1 -> NodeInfo
nodeInfo (CFunDef [CDeclarationSpecifier t1]
_ CDeclarator t1
_ [CDeclaration t1]
_ CStatement t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CFunctionDef t1) where
        posOf :: CFunctionDef t1 -> Position
posOf CFunctionDef t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CFunctionDef t1
x)

instance Functor CFunctionDef where
        fmap :: forall a b. (a -> b) -> CFunctionDef a -> CFunctionDef b
fmap a -> b
_f (CFunDef [CDeclarationSpecifier a]
a1 CDeclarator a
a2 [CDeclaration a]
a3 CStatement a
a4 a
a5)
          = forall a.
[CDeclarationSpecifier a]
-> CDeclarator a
-> [CDeclaration a]
-> CStatement a
-> a
-> CFunctionDef a
CFunDef (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CDeclarationSpecifier a]
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CDeclarator a
a2) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CDeclaration a]
a3)
              (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStatement a
a4)
              (a -> b
_f a
a5)

instance Annotated CFunctionDef where
        annotation :: forall a. CFunctionDef a -> a
annotation (CFunDef [CDeclarationSpecifier a]
_ CDeclarator a
_ [CDeclaration a]
_ CStatement a
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CFunctionDef a -> CFunctionDef a
amap a -> a
f (CFunDef [CDeclarationSpecifier a]
a_1 CDeclarator a
a_2 [CDeclaration a]
a_3 CStatement a
a_4 a
a_5)
          = forall a.
[CDeclarationSpecifier a]
-> CDeclarator a
-> [CDeclaration a]
-> CStatement a
-> a
-> CFunctionDef a
CFunDef [CDeclarationSpecifier a]
a_1 CDeclarator a
a_2 [CDeclaration a]
a_3 CStatement a
a_4 (a -> a
f a
a_5)

instance CNode t1 => CNode (CDeclaration t1) where
        nodeInfo :: CDeclaration t1 -> NodeInfo
nodeInfo (CDecl [CDeclarationSpecifier t1]
_ [(Maybe (CDeclarator t1), Maybe (CInitializer t1),
  Maybe (CExpression t1))]
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CStaticAssert CExpression t1
_ CStringLiteral t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CDeclaration t1) where
        posOf :: CDeclaration t1 -> Position
posOf CDeclaration t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CDeclaration t1
x)

instance Annotated CDeclaration where
        annotation :: forall a. CDeclaration a -> a
annotation (CDecl [CDeclarationSpecifier a]
_ [(Maybe (CDeclarator a), Maybe (CInitializer a),
  Maybe (CExpression a))]
_ a
n) = a
n
        annotation (CStaticAssert CExpression a
_ CStringLiteral a
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CDeclaration a -> CDeclaration a
amap a -> a
f (CDecl [CDeclarationSpecifier a]
a_1 [(Maybe (CDeclarator a), Maybe (CInitializer a),
  Maybe (CExpression a))]
a_2 a
a_3) = forall a.
[CDeclarationSpecifier a]
-> [(Maybe (CDeclarator a), Maybe (CInitializer a),
     Maybe (CExpression a))]
-> a
-> CDeclaration a
CDecl [CDeclarationSpecifier a]
a_1 [(Maybe (CDeclarator a), Maybe (CInitializer a),
  Maybe (CExpression a))]
a_2 (a -> a
f a
a_3)
        amap a -> a
f (CStaticAssert CExpression a
a_1 CStringLiteral a
a_2 a
a_3) = forall a. CExpression a -> CStringLiteral a -> a -> CDeclaration a
CStaticAssert CExpression a
a_1 CStringLiteral a
a_2 (a -> a
f a
a_3)

instance CNode t1 => CNode (CDeclarator t1) where
        nodeInfo :: CDeclarator t1 -> NodeInfo
nodeInfo (CDeclr Maybe Ident
_ [CDerivedDeclarator t1]
_ Maybe (CStringLiteral t1)
_ [CAttribute t1]
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CDeclarator t1) where
        posOf :: CDeclarator t1 -> Position
posOf CDeclarator t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CDeclarator t1
x)

instance Functor CDeclarator where
        fmap :: forall a b. (a -> b) -> CDeclarator a -> CDeclarator b
fmap a -> b
_f (CDeclr Maybe Ident
a1 [CDerivedDeclarator a]
a2 Maybe (CStringLiteral a)
a3 [CAttribute a]
a4 a
a5)
          = forall a.
Maybe Ident
-> [CDerivedDeclarator a]
-> Maybe (CStringLiteral a)
-> [CAttribute a]
-> a
-> CDeclarator a
CDeclr Maybe Ident
a1 (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CDerivedDeclarator a]
a2) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) Maybe (CStringLiteral a)
a3)
              (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CAttribute a]
a4)
              (a -> b
_f a
a5)

instance Annotated CDeclarator where
        annotation :: forall a. CDeclarator a -> a
annotation (CDeclr Maybe Ident
_ [CDerivedDeclarator a]
_ Maybe (CStringLiteral a)
_ [CAttribute a]
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CDeclarator a -> CDeclarator a
amap a -> a
f (CDeclr Maybe Ident
a_1 [CDerivedDeclarator a]
a_2 Maybe (CStringLiteral a)
a_3 [CAttribute a]
a_4 a
a_5)
          = forall a.
Maybe Ident
-> [CDerivedDeclarator a]
-> Maybe (CStringLiteral a)
-> [CAttribute a]
-> a
-> CDeclarator a
CDeclr Maybe Ident
a_1 [CDerivedDeclarator a]
a_2 Maybe (CStringLiteral a)
a_3 [CAttribute a]
a_4 (a -> a
f a
a_5)

instance CNode t1 => CNode (CDerivedDeclarator t1) where
        nodeInfo :: CDerivedDeclarator t1 -> NodeInfo
nodeInfo (CPtrDeclr [CTypeQualifier t1]
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CArrDeclr [CTypeQualifier t1]
_ CArraySize t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CFunDeclr Either [Ident] ([CDeclaration t1], Bool)
_ [CAttribute t1]
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CDerivedDeclarator t1) where
        posOf :: CDerivedDeclarator t1 -> Position
posOf CDerivedDeclarator t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CDerivedDeclarator t1
x)

instance Annotated CDerivedDeclarator where
        annotation :: forall a. CDerivedDeclarator a -> a
annotation (CPtrDeclr [CTypeQualifier a]
_ a
n) = a
n
        annotation (CArrDeclr [CTypeQualifier a]
_ CArraySize a
_ a
n) = a
n
        annotation (CFunDeclr Either [Ident] ([CDeclaration a], Bool)
_ [CAttribute a]
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CDerivedDeclarator a -> CDerivedDeclarator a
amap a -> a
f (CPtrDeclr [CTypeQualifier a]
a_1 a
a_2) = forall a. [CTypeQualifier a] -> a -> CDerivedDeclarator a
CPtrDeclr [CTypeQualifier a]
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CArrDeclr [CTypeQualifier a]
a_1 CArraySize a
a_2 a
a_3) = forall a.
[CTypeQualifier a] -> CArraySize a -> a -> CDerivedDeclarator a
CArrDeclr [CTypeQualifier a]
a_1 CArraySize a
a_2 (a -> a
f a
a_3)
        amap a -> a
f (CFunDeclr Either [Ident] ([CDeclaration a], Bool)
a_1 [CAttribute a]
a_2 a
a_3) = forall a.
Either [Ident] ([CDeclaration a], Bool)
-> [CAttribute a] -> a -> CDerivedDeclarator a
CFunDeclr Either [Ident] ([CDeclaration a], Bool)
a_1 [CAttribute a]
a_2 (a -> a
f a
a_3)

instance Functor CArraySize where
        fmap :: forall a b. (a -> b) -> CArraySize a -> CArraySize b
fmap a -> b
_ (CNoArrSize Bool
a1) = forall a. Bool -> CArraySize a
CNoArrSize Bool
a1
        fmap a -> b
_f (CArrSize Bool
a1 CExpression a
a2) = forall a. Bool -> CExpression a -> CArraySize a
CArrSize Bool
a1 (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a2)

instance CNode t1 => CNode (CStatement t1) where
        nodeInfo :: CStatement t1 -> NodeInfo
nodeInfo (CLabel Ident
_ CStatement t1
_ [CAttribute t1]
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CCase CExpression t1
_ CStatement t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CCases CExpression t1
_ CExpression t1
_ CStatement t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CDefault CStatement t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CExpr Maybe (CExpression t1)
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CCompound [Ident]
_ [CCompoundBlockItem t1]
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CIf CExpression t1
_ CStatement t1
_ Maybe (CStatement t1)
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CSwitch CExpression t1
_ CStatement t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CWhile CExpression t1
_ CStatement t1
_ Bool
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CFor Either (Maybe (CExpression t1)) (CDeclaration t1)
_ Maybe (CExpression t1)
_ Maybe (CExpression t1)
_ CStatement t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CGoto Ident
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CGotoPtr CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CCont t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CBreak t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CReturn Maybe (CExpression t1)
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CAsm CAssemblyStatement t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CStatement t1) where
        posOf :: CStatement t1 -> Position
posOf CStatement t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CStatement t1
x)

instance Annotated CStatement where
        annotation :: forall a. CStatement a -> a
annotation (CLabel Ident
_ CStatement a
_ [CAttribute a]
_ a
n) = a
n
        annotation (CCase CExpression a
_ CStatement a
_ a
n) = a
n
        annotation (CCases CExpression a
_ CExpression a
_ CStatement a
_ a
n) = a
n
        annotation (CDefault CStatement a
_ a
n) = a
n
        annotation (CExpr Maybe (CExpression a)
_ a
n) = a
n
        annotation (CCompound [Ident]
_ [CCompoundBlockItem a]
_ a
n) = a
n
        annotation (CIf CExpression a
_ CStatement a
_ Maybe (CStatement a)
_ a
n) = a
n
        annotation (CSwitch CExpression a
_ CStatement a
_ a
n) = a
n
        annotation (CWhile CExpression a
_ CStatement a
_ Bool
_ a
n) = a
n
        annotation (CFor Either (Maybe (CExpression a)) (CDeclaration a)
_ Maybe (CExpression a)
_ Maybe (CExpression a)
_ CStatement a
_ a
n) = a
n
        annotation (CGoto Ident
_ a
n) = a
n
        annotation (CGotoPtr CExpression a
_ a
n) = a
n
        annotation (CCont a
n) = a
n
        annotation (CBreak a
n) = a
n
        annotation (CReturn Maybe (CExpression a)
_ a
n) = a
n
        annotation (CAsm CAssemblyStatement a
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CStatement a -> CStatement a
amap a -> a
f (CLabel Ident
a_1 CStatement a
a_2 [CAttribute a]
a_3 a
a_4) = forall a.
Ident -> CStatement a -> [CAttribute a] -> a -> CStatement a
CLabel Ident
a_1 CStatement a
a_2 [CAttribute a]
a_3 (a -> a
f a
a_4)
        amap a -> a
f (CCase CExpression a
a_1 CStatement a
a_2 a
a_3) = forall a. CExpression a -> CStatement a -> a -> CStatement a
CCase CExpression a
a_1 CStatement a
a_2 (a -> a
f a
a_3)
        amap a -> a
f (CCases CExpression a
a_1 CExpression a
a_2 CStatement a
a_3 a
a_4) = forall a.
CExpression a -> CExpression a -> CStatement a -> a -> CStatement a
CCases CExpression a
a_1 CExpression a
a_2 CStatement a
a_3 (a -> a
f a
a_4)
        amap a -> a
f (CDefault CStatement a
a_1 a
a_2) = forall a. CStatement a -> a -> CStatement a
CDefault CStatement a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CExpr Maybe (CExpression a)
a_1 a
a_2) = forall a. Maybe (CExpression a) -> a -> CStatement a
CExpr Maybe (CExpression a)
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CCompound [Ident]
a_1 [CCompoundBlockItem a]
a_2 a
a_3) = forall a. [Ident] -> [CCompoundBlockItem a] -> a -> CStatement a
CCompound [Ident]
a_1 [CCompoundBlockItem a]
a_2 (a -> a
f a
a_3)
        amap a -> a
f (CIf CExpression a
a_1 CStatement a
a_2 Maybe (CStatement a)
a_3 a
a_4) = forall a.
CExpression a
-> CStatement a -> Maybe (CStatement a) -> a -> CStatement a
CIf CExpression a
a_1 CStatement a
a_2 Maybe (CStatement a)
a_3 (a -> a
f a
a_4)
        amap a -> a
f (CSwitch CExpression a
a_1 CStatement a
a_2 a
a_3) = forall a. CExpression a -> CStatement a -> a -> CStatement a
CSwitch CExpression a
a_1 CStatement a
a_2 (a -> a
f a
a_3)
        amap a -> a
f (CWhile CExpression a
a_1 CStatement a
a_2 Bool
a_3 a
a_4) = forall a.
CExpression a -> CStatement a -> Bool -> a -> CStatement a
CWhile CExpression a
a_1 CStatement a
a_2 Bool
a_3 (a -> a
f a
a_4)
        amap a -> a
f (CFor Either (Maybe (CExpression a)) (CDeclaration a)
a_1 Maybe (CExpression a)
a_2 Maybe (CExpression a)
a_3 CStatement a
a_4 a
a_5) = forall a.
Either (Maybe (CExpression a)) (CDeclaration a)
-> Maybe (CExpression a)
-> Maybe (CExpression a)
-> CStatement a
-> a
-> CStatement a
CFor Either (Maybe (CExpression a)) (CDeclaration a)
a_1 Maybe (CExpression a)
a_2 Maybe (CExpression a)
a_3 CStatement a
a_4 (a -> a
f a
a_5)
        amap a -> a
f (CGoto Ident
a_1 a
a_2) = forall a. Ident -> a -> CStatement a
CGoto Ident
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CGotoPtr CExpression a
a_1 a
a_2) = forall a. CExpression a -> a -> CStatement a
CGotoPtr CExpression a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CCont a
a_1) = forall a. a -> CStatement a
CCont (a -> a
f a
a_1)
        amap a -> a
f (CBreak a
a_1) = forall a. a -> CStatement a
CBreak (a -> a
f a
a_1)
        amap a -> a
f (CReturn Maybe (CExpression a)
a_1 a
a_2) = forall a. Maybe (CExpression a) -> a -> CStatement a
CReturn Maybe (CExpression a)
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CAsm CAssemblyStatement a
a_1 a
a_2) = forall a. CAssemblyStatement a -> a -> CStatement a
CAsm CAssemblyStatement a
a_1 (a -> a
f a
a_2)

instance CNode t1 => CNode (CAssemblyStatement t1) where
        nodeInfo :: CAssemblyStatement t1 -> NodeInfo
nodeInfo (CAsmStmt Maybe (CTypeQualifier t1)
_ CStringLiteral t1
_ [CAssemblyOperand t1]
_ [CAssemblyOperand t1]
_ [CStringLiteral t1]
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CAssemblyStatement t1) where
        posOf :: CAssemblyStatement t1 -> Position
posOf CAssemblyStatement t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CAssemblyStatement t1
x)

instance Functor CAssemblyStatement where
        fmap :: forall a b.
(a -> b) -> CAssemblyStatement a -> CAssemblyStatement b
fmap a -> b
_f (CAsmStmt Maybe (CTypeQualifier a)
a1 CStringLiteral a
a2 [CAssemblyOperand a]
a3 [CAssemblyOperand a]
a4 [CStringLiteral a]
a5 a
a6)
          = forall a.
Maybe (CTypeQualifier a)
-> CStringLiteral a
-> [CAssemblyOperand a]
-> [CAssemblyOperand a]
-> [CStringLiteral a]
-> a
-> CAssemblyStatement a
CAsmStmt (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) Maybe (CTypeQualifier a)
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStringLiteral a
a2) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CAssemblyOperand a]
a3)
              (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CAssemblyOperand a]
a4)
              (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CStringLiteral a]
a5)
              (a -> b
_f a
a6)

instance Annotated CAssemblyStatement where
        annotation :: forall a. CAssemblyStatement a -> a
annotation (CAsmStmt Maybe (CTypeQualifier a)
_ CStringLiteral a
_ [CAssemblyOperand a]
_ [CAssemblyOperand a]
_ [CStringLiteral a]
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CAssemblyStatement a -> CAssemblyStatement a
amap a -> a
f (CAsmStmt Maybe (CTypeQualifier a)
a_1 CStringLiteral a
a_2 [CAssemblyOperand a]
a_3 [CAssemblyOperand a]
a_4 [CStringLiteral a]
a_5 a
a_6)
          = forall a.
Maybe (CTypeQualifier a)
-> CStringLiteral a
-> [CAssemblyOperand a]
-> [CAssemblyOperand a]
-> [CStringLiteral a]
-> a
-> CAssemblyStatement a
CAsmStmt Maybe (CTypeQualifier a)
a_1 CStringLiteral a
a_2 [CAssemblyOperand a]
a_3 [CAssemblyOperand a]
a_4 [CStringLiteral a]
a_5 (a -> a
f a
a_6)

instance CNode t1 => CNode (CAssemblyOperand t1) where
        nodeInfo :: CAssemblyOperand t1 -> NodeInfo
nodeInfo (CAsmOperand Maybe Ident
_ CStringLiteral t1
_ CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CAssemblyOperand t1) where
        posOf :: CAssemblyOperand t1 -> Position
posOf CAssemblyOperand t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CAssemblyOperand t1
x)

instance Functor CAssemblyOperand where
        fmap :: forall a b. (a -> b) -> CAssemblyOperand a -> CAssemblyOperand b
fmap a -> b
_f (CAsmOperand Maybe Ident
a1 CStringLiteral a
a2 CExpression a
a3 a
a4)
          = forall a.
Maybe Ident
-> CStringLiteral a -> CExpression a -> a -> CAssemblyOperand a
CAsmOperand Maybe Ident
a1 (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStringLiteral a
a2) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a3) (a -> b
_f a
a4)

instance Annotated CAssemblyOperand where
        annotation :: forall a. CAssemblyOperand a -> a
annotation (CAsmOperand Maybe Ident
_ CStringLiteral a
_ CExpression a
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CAssemblyOperand a -> CAssemblyOperand a
amap a -> a
f (CAsmOperand Maybe Ident
a_1 CStringLiteral a
a_2 CExpression a
a_3 a
a_4)
          = forall a.
Maybe Ident
-> CStringLiteral a -> CExpression a -> a -> CAssemblyOperand a
CAsmOperand Maybe Ident
a_1 CStringLiteral a
a_2 CExpression a
a_3 (a -> a
f a
a_4)

instance CNode t1 => CNode (CCompoundBlockItem t1) where
        nodeInfo :: CCompoundBlockItem t1 -> NodeInfo
nodeInfo (CBlockStmt CStatement t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo CStatement t1
d
        nodeInfo (CBlockDecl CDeclaration t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo CDeclaration t1
d
        nodeInfo (CNestedFunDef CFunctionDef t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo CFunctionDef t1
d
instance CNode t1 => Pos (CCompoundBlockItem t1) where
        posOf :: CCompoundBlockItem t1 -> Position
posOf CCompoundBlockItem t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CCompoundBlockItem t1
x)

instance Functor CCompoundBlockItem where
        fmap :: forall a b.
(a -> b) -> CCompoundBlockItem a -> CCompoundBlockItem b
fmap a -> b
_f (CBlockStmt CStatement a
a1) = forall a. CStatement a -> CCompoundBlockItem a
CBlockStmt (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStatement a
a1)
        fmap a -> b
_f (CBlockDecl CDeclaration a
a1) = forall a. CDeclaration a -> CCompoundBlockItem a
CBlockDecl (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CDeclaration a
a1)
        fmap a -> b
_f (CNestedFunDef CFunctionDef a
a1) = forall a. CFunctionDef a -> CCompoundBlockItem a
CNestedFunDef (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CFunctionDef a
a1)

instance Annotated CCompoundBlockItem where
        annotation :: forall a. CCompoundBlockItem a -> a
annotation (CBlockStmt CStatement a
n) = forall (ast :: * -> *) a. Annotated ast => ast a -> a
annotation CStatement a
n
        annotation (CBlockDecl CDeclaration a
n) = forall (ast :: * -> *) a. Annotated ast => ast a -> a
annotation CDeclaration a
n
        annotation (CNestedFunDef CFunctionDef a
n) = forall (ast :: * -> *) a. Annotated ast => ast a -> a
annotation CFunctionDef a
n
        amap :: forall a. (a -> a) -> CCompoundBlockItem a -> CCompoundBlockItem a
amap a -> a
f (CBlockStmt CStatement a
n) = forall a. CStatement a -> CCompoundBlockItem a
CBlockStmt (forall (ast :: * -> *) a.
Annotated ast =>
(a -> a) -> ast a -> ast a
amap a -> a
f CStatement a
n)
        amap a -> a
f (CBlockDecl CDeclaration a
n) = forall a. CDeclaration a -> CCompoundBlockItem a
CBlockDecl (forall (ast :: * -> *) a.
Annotated ast =>
(a -> a) -> ast a -> ast a
amap a -> a
f CDeclaration a
n)
        amap a -> a
f (CNestedFunDef CFunctionDef a
n) = forall a. CFunctionDef a -> CCompoundBlockItem a
CNestedFunDef (forall (ast :: * -> *) a.
Annotated ast =>
(a -> a) -> ast a -> ast a
amap a -> a
f CFunctionDef a
n)

instance CNode t1 => CNode (CDeclarationSpecifier t1) where
        nodeInfo :: CDeclarationSpecifier t1 -> NodeInfo
nodeInfo (CStorageSpec CStorageSpecifier t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo CStorageSpecifier t1
d
        nodeInfo (CTypeSpec CTypeSpecifier t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo CTypeSpecifier t1
d
        nodeInfo (CTypeQual CTypeQualifier t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo CTypeQualifier t1
d
        nodeInfo (CFunSpec CFunctionSpecifier t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo CFunctionSpecifier t1
d
        nodeInfo (CAlignSpec CAlignmentSpecifier t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo CAlignmentSpecifier t1
d
instance CNode t1 => Pos (CDeclarationSpecifier t1) where
        posOf :: CDeclarationSpecifier t1 -> Position
posOf CDeclarationSpecifier t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CDeclarationSpecifier t1
x)

instance Functor CDeclarationSpecifier where
        fmap :: forall a b.
(a -> b) -> CDeclarationSpecifier a -> CDeclarationSpecifier b
fmap a -> b
_f (CStorageSpec CStorageSpecifier a
a1) = forall a. CStorageSpecifier a -> CDeclarationSpecifier a
CStorageSpec (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStorageSpecifier a
a1)
        fmap a -> b
_f (CTypeSpec CTypeSpecifier a
a1) = forall a. CTypeSpecifier a -> CDeclarationSpecifier a
CTypeSpec (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CTypeSpecifier a
a1)
        fmap a -> b
_f (CTypeQual CTypeQualifier a
a1) = forall a. CTypeQualifier a -> CDeclarationSpecifier a
CTypeQual (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CTypeQualifier a
a1)
        fmap a -> b
_f (CFunSpec CFunctionSpecifier a
a1) = forall a. CFunctionSpecifier a -> CDeclarationSpecifier a
CFunSpec (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CFunctionSpecifier a
a1)
        fmap a -> b
_f (CAlignSpec CAlignmentSpecifier a
a1) = forall a. CAlignmentSpecifier a -> CDeclarationSpecifier a
CAlignSpec (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CAlignmentSpecifier a
a1)

instance Annotated CDeclarationSpecifier where
        annotation :: forall a. CDeclarationSpecifier a -> a
annotation (CStorageSpec CStorageSpecifier a
n) = forall (ast :: * -> *) a. Annotated ast => ast a -> a
annotation CStorageSpecifier a
n
        annotation (CTypeSpec CTypeSpecifier a
n) = forall (ast :: * -> *) a. Annotated ast => ast a -> a
annotation CTypeSpecifier a
n
        annotation (CTypeQual CTypeQualifier a
n) = forall (ast :: * -> *) a. Annotated ast => ast a -> a
annotation CTypeQualifier a
n
        annotation (CFunSpec CFunctionSpecifier a
n) = forall (ast :: * -> *) a. Annotated ast => ast a -> a
annotation CFunctionSpecifier a
n
        annotation (CAlignSpec CAlignmentSpecifier a
n) = forall (ast :: * -> *) a. Annotated ast => ast a -> a
annotation CAlignmentSpecifier a
n
        amap :: forall a.
(a -> a) -> CDeclarationSpecifier a -> CDeclarationSpecifier a
amap a -> a
f (CStorageSpec CStorageSpecifier a
n) = forall a. CStorageSpecifier a -> CDeclarationSpecifier a
CStorageSpec (forall (ast :: * -> *) a.
Annotated ast =>
(a -> a) -> ast a -> ast a
amap a -> a
f CStorageSpecifier a
n)
        amap a -> a
f (CTypeSpec CTypeSpecifier a
n) = forall a. CTypeSpecifier a -> CDeclarationSpecifier a
CTypeSpec (forall (ast :: * -> *) a.
Annotated ast =>
(a -> a) -> ast a -> ast a
amap a -> a
f CTypeSpecifier a
n)
        amap a -> a
f (CTypeQual CTypeQualifier a
n) = forall a. CTypeQualifier a -> CDeclarationSpecifier a
CTypeQual (forall (ast :: * -> *) a.
Annotated ast =>
(a -> a) -> ast a -> ast a
amap a -> a
f CTypeQualifier a
n)
        amap a -> a
f (CFunSpec CFunctionSpecifier a
n) = forall a. CFunctionSpecifier a -> CDeclarationSpecifier a
CFunSpec (forall (ast :: * -> *) a.
Annotated ast =>
(a -> a) -> ast a -> ast a
amap a -> a
f CFunctionSpecifier a
n)
        amap a -> a
f (CAlignSpec CAlignmentSpecifier a
n) = forall a. CAlignmentSpecifier a -> CDeclarationSpecifier a
CAlignSpec (forall (ast :: * -> *) a.
Annotated ast =>
(a -> a) -> ast a -> ast a
amap a -> a
f CAlignmentSpecifier a
n)

instance CNode t1 => CNode (CStorageSpecifier t1) where
        nodeInfo :: CStorageSpecifier t1 -> NodeInfo
nodeInfo (CAuto t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CRegister t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CStatic t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CExtern t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CTypedef t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CThread t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CClKernel t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CClGlobal t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CClLocal t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
instance CNode t1 => Pos (CStorageSpecifier t1) where
        posOf :: CStorageSpecifier t1 -> Position
posOf CStorageSpecifier t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CStorageSpecifier t1
x)

instance Functor CStorageSpecifier where
        fmap :: forall a b. (a -> b) -> CStorageSpecifier a -> CStorageSpecifier b
fmap a -> b
_f (CAuto a
a1) = forall a. a -> CStorageSpecifier a
CAuto (a -> b
_f a
a1)
        fmap a -> b
_f (CRegister a
a1) = forall a. a -> CStorageSpecifier a
CRegister (a -> b
_f a
a1)
        fmap a -> b
_f (CStatic a
a1) = forall a. a -> CStorageSpecifier a
CStatic (a -> b
_f a
a1)
        fmap a -> b
_f (CExtern a
a1) = forall a. a -> CStorageSpecifier a
CExtern (a -> b
_f a
a1)
        fmap a -> b
_f (CTypedef a
a1) = forall a. a -> CStorageSpecifier a
CTypedef (a -> b
_f a
a1)
        fmap a -> b
_f (CThread a
a1) = forall a. a -> CStorageSpecifier a
CThread (a -> b
_f a
a1)
        fmap a -> b
_f (CClKernel a
a1) = forall a. a -> CStorageSpecifier a
CClKernel (a -> b
_f a
a1)
        fmap a -> b
_f (CClGlobal a
a1) = forall a. a -> CStorageSpecifier a
CClGlobal (a -> b
_f a
a1)
        fmap a -> b
_f (CClLocal a
a1) = forall a. a -> CStorageSpecifier a
CClLocal (a -> b
_f a
a1)

instance Annotated CStorageSpecifier where
        annotation :: forall a. CStorageSpecifier a -> a
annotation (CAuto a
n) = a
n
        annotation (CRegister a
n) = a
n
        annotation (CStatic a
n) = a
n
        annotation (CExtern a
n) = a
n
        annotation (CTypedef a
n) = a
n
        annotation (CThread a
n) = a
n
        annotation (CClKernel a
n) = a
n
        annotation (CClGlobal a
n) = a
n
        annotation (CClLocal a
n) = a
n
        amap :: forall a. (a -> a) -> CStorageSpecifier a -> CStorageSpecifier a
amap a -> a
f (CAuto a
a_1) = forall a. a -> CStorageSpecifier a
CAuto (a -> a
f a
a_1)
        amap a -> a
f (CRegister a
a_1) = forall a. a -> CStorageSpecifier a
CRegister (a -> a
f a
a_1)
        amap a -> a
f (CStatic a
a_1) = forall a. a -> CStorageSpecifier a
CStatic (a -> a
f a
a_1)
        amap a -> a
f (CExtern a
a_1) = forall a. a -> CStorageSpecifier a
CExtern (a -> a
f a
a_1)
        amap a -> a
f (CTypedef a
a_1) = forall a. a -> CStorageSpecifier a
CTypedef (a -> a
f a
a_1)
        amap a -> a
f (CThread a
a_1) = forall a. a -> CStorageSpecifier a
CThread (a -> a
f a
a_1)
        amap a -> a
f (CClKernel a
a_1) = forall a. a -> CStorageSpecifier a
CClKernel (a -> a
f a
a_1)
        amap a -> a
f (CClGlobal a
a_1) = forall a. a -> CStorageSpecifier a
CClGlobal (a -> a
f a
a_1)
        amap a -> a
f (CClLocal a
a_1) = forall a. a -> CStorageSpecifier a
CClLocal (a -> a
f a
a_1)

instance CNode t1 => CNode (CTypeSpecifier t1) where
        nodeInfo :: CTypeSpecifier t1 -> NodeInfo
nodeInfo (CVoidType t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CCharType t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CShortType t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CIntType t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CLongType t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CFloatType t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CFloatNType Int
_ Bool
_ t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CDoubleType t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CSignedType t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CUnsigType t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CBoolType t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CComplexType t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CInt128Type t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CSUType CStructureUnion t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CEnumType CEnumeration t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CTypeDef Ident
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CTypeOfExpr CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CTypeOfType CDeclaration t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CAtomicType CDeclaration t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CTypeSpecifier t1) where
        posOf :: CTypeSpecifier t1 -> Position
posOf CTypeSpecifier t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CTypeSpecifier t1
x)

instance Functor CTypeSpecifier where
        fmap :: forall a b. (a -> b) -> CTypeSpecifier a -> CTypeSpecifier b
fmap a -> b
_f (CVoidType a
a1) = forall a. a -> CTypeSpecifier a
CVoidType (a -> b
_f a
a1)
        fmap a -> b
_f (CCharType a
a1) = forall a. a -> CTypeSpecifier a
CCharType (a -> b
_f a
a1)
        fmap a -> b
_f (CShortType a
a1) = forall a. a -> CTypeSpecifier a
CShortType (a -> b
_f a
a1)
        fmap a -> b
_f (CIntType a
a1) = forall a. a -> CTypeSpecifier a
CIntType (a -> b
_f a
a1)
        fmap a -> b
_f (CLongType a
a1) = forall a. a -> CTypeSpecifier a
CLongType (a -> b
_f a
a1)
        fmap a -> b
_f (CFloatType a
a1) = forall a. a -> CTypeSpecifier a
CFloatType (a -> b
_f a
a1)
        fmap a -> b
_f (CFloatNType Int
n Bool
x a
a1) = forall a. Int -> Bool -> a -> CTypeSpecifier a
CFloatNType Int
n Bool
x (a -> b
_f a
a1)
        fmap a -> b
_f (CDoubleType a
a1) = forall a. a -> CTypeSpecifier a
CDoubleType (a -> b
_f a
a1)
        fmap a -> b
_f (CSignedType a
a1) = forall a. a -> CTypeSpecifier a
CSignedType (a -> b
_f a
a1)
        fmap a -> b
_f (CUnsigType a
a1) = forall a. a -> CTypeSpecifier a
CUnsigType (a -> b
_f a
a1)
        fmap a -> b
_f (CBoolType a
a1) = forall a. a -> CTypeSpecifier a
CBoolType (a -> b
_f a
a1)
        fmap a -> b
_f (CComplexType a
a1) = forall a. a -> CTypeSpecifier a
CComplexType (a -> b
_f a
a1)
        fmap a -> b
_f (CInt128Type a
a1) = forall a. a -> CTypeSpecifier a
CInt128Type (a -> b
_f a
a1)
        fmap a -> b
_f (CSUType CStructureUnion a
a1 a
a2) = forall a. CStructureUnion a -> a -> CTypeSpecifier a
CSUType (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CStructureUnion a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CEnumType CEnumeration a
a1 a
a2) = forall a. CEnumeration a -> a -> CTypeSpecifier a
CEnumType (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CEnumeration a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CTypeDef Ident
a1 a
a2) = forall a. Ident -> a -> CTypeSpecifier a
CTypeDef Ident
a1 (a -> b
_f a
a2)
        fmap a -> b
_f (CTypeOfExpr CExpression a
a1 a
a2) = forall a. CExpression a -> a -> CTypeSpecifier a
CTypeOfExpr (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CTypeOfType CDeclaration a
a1 a
a2) = forall a. CDeclaration a -> a -> CTypeSpecifier a
CTypeOfType (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CDeclaration a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CAtomicType CDeclaration a
a1 a
a2) = forall a. CDeclaration a -> a -> CTypeSpecifier a
CAtomicType (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CDeclaration a
a1) (a -> b
_f a
a2)

instance Annotated CTypeSpecifier where
        annotation :: forall a. CTypeSpecifier a -> a
annotation (CVoidType a
n) = a
n
        annotation (CCharType a
n) = a
n
        annotation (CShortType a
n) = a
n
        annotation (CIntType a
n) = a
n
        annotation (CLongType a
n) = a
n
        annotation (CFloatType a
n) = a
n
        annotation (CFloatNType Int
_ Bool
_ a
n) = a
n
        annotation (CDoubleType a
n) = a
n
        annotation (CSignedType a
n) = a
n
        annotation (CUnsigType a
n) = a
n
        annotation (CBoolType a
n) = a
n
        annotation (CComplexType a
n) = a
n
        annotation (CInt128Type a
n) = a
n
        annotation (CSUType CStructureUnion a
_ a
n) = a
n
        annotation (CEnumType CEnumeration a
_ a
n) = a
n
        annotation (CTypeDef Ident
_ a
n) = a
n
        annotation (CTypeOfExpr CExpression a
_ a
n) = a
n
        annotation (CTypeOfType CDeclaration a
_ a
n) = a
n
        annotation (CAtomicType CDeclaration a
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CTypeSpecifier a -> CTypeSpecifier a
amap a -> a
f (CVoidType a
a_1) = forall a. a -> CTypeSpecifier a
CVoidType (a -> a
f a
a_1)
        amap a -> a
f (CCharType a
a_1) = forall a. a -> CTypeSpecifier a
CCharType (a -> a
f a
a_1)
        amap a -> a
f (CShortType a
a_1) = forall a. a -> CTypeSpecifier a
CShortType (a -> a
f a
a_1)
        amap a -> a
f (CIntType a
a_1) = forall a. a -> CTypeSpecifier a
CIntType (a -> a
f a
a_1)
        amap a -> a
f (CLongType a
a_1) = forall a. a -> CTypeSpecifier a
CLongType (a -> a
f a
a_1)
        amap a -> a
f (CFloatType a
a_1) = forall a. a -> CTypeSpecifier a
CFloatType (a -> a
f a
a_1)
        amap a -> a
f (CFloatNType Int
n Bool
x a
a_1) = forall a. Int -> Bool -> a -> CTypeSpecifier a
CFloatNType Int
n Bool
x (a -> a
f a
a_1)
        amap a -> a
f (CDoubleType a
a_1) = forall a. a -> CTypeSpecifier a
CDoubleType (a -> a
f a
a_1)
        amap a -> a
f (CSignedType a
a_1) = forall a. a -> CTypeSpecifier a
CSignedType (a -> a
f a
a_1)
        amap a -> a
f (CUnsigType a
a_1) = forall a. a -> CTypeSpecifier a
CUnsigType (a -> a
f a
a_1)
        amap a -> a
f (CBoolType a
a_1) = forall a. a -> CTypeSpecifier a
CBoolType (a -> a
f a
a_1)
        amap a -> a
f (CComplexType a
a_1) = forall a. a -> CTypeSpecifier a
CComplexType (a -> a
f a
a_1)
        amap a -> a
f (CInt128Type a
a_1) = forall a. a -> CTypeSpecifier a
CInt128Type (a -> a
f a
a_1)
        amap a -> a
f (CSUType CStructureUnion a
a_1 a
a_2) = forall a. CStructureUnion a -> a -> CTypeSpecifier a
CSUType CStructureUnion a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CEnumType CEnumeration a
a_1 a
a_2) = forall a. CEnumeration a -> a -> CTypeSpecifier a
CEnumType CEnumeration a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CTypeDef Ident
a_1 a
a_2) = forall a. Ident -> a -> CTypeSpecifier a
CTypeDef Ident
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CTypeOfExpr CExpression a
a_1 a
a_2) = forall a. CExpression a -> a -> CTypeSpecifier a
CTypeOfExpr CExpression a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CTypeOfType CDeclaration a
a_1 a
a_2) = forall a. CDeclaration a -> a -> CTypeSpecifier a
CTypeOfType CDeclaration a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CAtomicType CDeclaration a
a_1 a
a_2) = forall a. CDeclaration a -> a -> CTypeSpecifier a
CAtomicType CDeclaration a
a_1 (a -> a
f a
a_2)

instance CNode t1 => CNode (CTypeQualifier t1) where
        nodeInfo :: CTypeQualifier t1 -> NodeInfo
nodeInfo (CConstQual t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CVolatQual t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CRestrQual t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CAtomicQual t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CAttrQual CAttribute t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo CAttribute t1
d
        nodeInfo (CNullableQual t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CNonnullQual t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CClRdOnlyQual t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CClWrOnlyQual t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d

instance CNode t1 => Pos (CTypeQualifier t1) where
        posOf :: CTypeQualifier t1 -> Position
posOf CTypeQualifier t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CTypeQualifier t1
x)

instance Functor CTypeQualifier where
        fmap :: forall a b. (a -> b) -> CTypeQualifier a -> CTypeQualifier b
fmap a -> b
_f (CConstQual a
a1) = forall a. a -> CTypeQualifier a
CConstQual (a -> b
_f a
a1)
        fmap a -> b
_f (CVolatQual a
a1) = forall a. a -> CTypeQualifier a
CVolatQual (a -> b
_f a
a1)
        fmap a -> b
_f (CRestrQual a
a1) = forall a. a -> CTypeQualifier a
CRestrQual (a -> b
_f a
a1)
        fmap a -> b
_f (CAtomicQual a
a1) = forall a. a -> CTypeQualifier a
CAtomicQual (a -> b
_f a
a1)
        fmap a -> b
_f (CAttrQual CAttribute a
a1) = forall a. CAttribute a -> CTypeQualifier a
CAttrQual (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CAttribute a
a1)
        fmap a -> b
_f (CNullableQual a
a1) = forall a. a -> CTypeQualifier a
CNullableQual (a -> b
_f a
a1)
        fmap a -> b
_f (CNonnullQual a
a1) = forall a. a -> CTypeQualifier a
CNonnullQual (a -> b
_f a
a1)
        fmap a -> b
_f (CClRdOnlyQual a
a1) = forall a. a -> CTypeQualifier a
CClRdOnlyQual (a -> b
_f a
a1)
        fmap a -> b
_f (CClWrOnlyQual a
a1) = forall a. a -> CTypeQualifier a
CClWrOnlyQual (a -> b
_f a
a1)

instance Annotated CTypeQualifier where
        annotation :: forall a. CTypeQualifier a -> a
annotation (CConstQual a
n) = a
n
        annotation (CVolatQual a
n) = a
n
        annotation (CRestrQual a
n) = a
n
        annotation (CAtomicQual a
n) = a
n
        annotation (CAttrQual CAttribute a
n) = forall (ast :: * -> *) a. Annotated ast => ast a -> a
annotation CAttribute a
n
        annotation (CNullableQual a
n) = a
n
        annotation (CNonnullQual a
n) = a
n
        annotation (CClRdOnlyQual a
n) = a
n
        annotation (CClWrOnlyQual a
n) = a
n
        amap :: forall a. (a -> a) -> CTypeQualifier a -> CTypeQualifier a
amap a -> a
f (CConstQual a
a_1) = forall a. a -> CTypeQualifier a
CConstQual (a -> a
f a
a_1)
        amap a -> a
f (CVolatQual a
a_1) = forall a. a -> CTypeQualifier a
CVolatQual (a -> a
f a
a_1)
        amap a -> a
f (CRestrQual a
a_1) = forall a. a -> CTypeQualifier a
CRestrQual (a -> a
f a
a_1)
        amap a -> a
f (CAtomicQual a
a_1) = forall a. a -> CTypeQualifier a
CAtomicQual (a -> a
f a
a_1)
        amap a -> a
f (CAttrQual CAttribute a
n) = forall a. CAttribute a -> CTypeQualifier a
CAttrQual (forall (ast :: * -> *) a.
Annotated ast =>
(a -> a) -> ast a -> ast a
amap a -> a
f CAttribute a
n)
        amap a -> a
f (CNullableQual a
a_1) = forall a. a -> CTypeQualifier a
CNullableQual (a -> a
f a
a_1)
        amap a -> a
f (CNonnullQual a
a_1) = forall a. a -> CTypeQualifier a
CNonnullQual (a -> a
f a
a_1)
        amap a -> a
f (CClRdOnlyQual a
a_1) = forall a. a -> CTypeQualifier a
CClRdOnlyQual (a -> a
f a
a_1)
        amap a -> a
f (CClWrOnlyQual a
a_1) = forall a. a -> CTypeQualifier a
CClWrOnlyQual (a -> a
f a
a_1)

instance CNode t1 => CNode (CFunctionSpecifier t1) where
        nodeInfo :: CFunctionSpecifier t1 -> NodeInfo
nodeInfo (CInlineQual t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
        nodeInfo (CNoreturnQual t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
d
instance CNode t1 => Pos (CFunctionSpecifier t1) where
        posOf :: CFunctionSpecifier t1 -> Position
posOf CFunctionSpecifier t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CFunctionSpecifier t1
x)

instance Functor CFunctionSpecifier where
        fmap :: forall a b.
(a -> b) -> CFunctionSpecifier a -> CFunctionSpecifier b
fmap a -> b
_f (CInlineQual a
a1) = forall a. a -> CFunctionSpecifier a
CInlineQual (a -> b
_f a
a1)
        fmap a -> b
_f (CNoreturnQual a
a1) = forall a. a -> CFunctionSpecifier a
CNoreturnQual (a -> b
_f a
a1)

instance Annotated CFunctionSpecifier where
        annotation :: forall a. CFunctionSpecifier a -> a
annotation (CInlineQual a
n) = a
n
        annotation (CNoreturnQual a
n) = a
n
        amap :: forall a. (a -> a) -> CFunctionSpecifier a -> CFunctionSpecifier a
amap a -> a
f (CInlineQual a
a_1) = forall a. a -> CFunctionSpecifier a
CInlineQual (a -> a
f a
a_1)
        amap a -> a
f (CNoreturnQual a
a_1) = forall a. a -> CFunctionSpecifier a
CNoreturnQual (a -> a
f a
a_1)

instance CNode t1 => CNode (CAlignmentSpecifier t1) where
        nodeInfo :: CAlignmentSpecifier t1 -> NodeInfo
nodeInfo (CAlignAsType CDeclaration t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CAlignAsExpr CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CAlignmentSpecifier t1) where
        posOf :: CAlignmentSpecifier t1 -> Position
posOf CAlignmentSpecifier t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CAlignmentSpecifier t1
x)

instance Functor CAlignmentSpecifier where
        fmap :: forall a b.
(a -> b) -> CAlignmentSpecifier a -> CAlignmentSpecifier b
fmap a -> b
_f (CAlignAsType CDeclaration a
a1 a
a2) = forall a. CDeclaration a -> a -> CAlignmentSpecifier a
CAlignAsType (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CDeclaration a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CAlignAsExpr CExpression a
a1 a
a2) = forall a. CExpression a -> a -> CAlignmentSpecifier a
CAlignAsExpr (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (a -> b
_f a
a2)

instance Annotated CAlignmentSpecifier where
        annotation :: forall a. CAlignmentSpecifier a -> a
annotation (CAlignAsType CDeclaration a
_ a
n) = a
n
        annotation (CAlignAsExpr CExpression a
_ a
n) = a
n
        amap :: forall a.
(a -> a) -> CAlignmentSpecifier a -> CAlignmentSpecifier a
amap a -> a
f (CAlignAsType CDeclaration a
a_1 a
a_2) = forall a. CDeclaration a -> a -> CAlignmentSpecifier a
CAlignAsType CDeclaration a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CAlignAsExpr CExpression a
a_1 a
a_2) = forall a. CExpression a -> a -> CAlignmentSpecifier a
CAlignAsExpr CExpression a
a_1 (a -> a
f a
a_2)

instance CNode t1 => CNode (CStructureUnion t1) where
        nodeInfo :: CStructureUnion t1 -> NodeInfo
nodeInfo (CStruct CStructTag
_ Maybe Ident
_ Maybe [CDeclaration t1]
_ [CAttribute t1]
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CStructureUnion t1) where
        posOf :: CStructureUnion t1 -> Position
posOf CStructureUnion t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CStructureUnion t1
x)

instance Functor CStructureUnion where
        fmap :: forall a b. (a -> b) -> CStructureUnion a -> CStructureUnion b
fmap a -> b
_f (CStruct CStructTag
a1 Maybe Ident
a2 Maybe [CDeclaration a]
a3 [CAttribute a]
a4 a
a5)
          = forall a.
CStructTag
-> Maybe Ident
-> Maybe [CDeclaration a]
-> [CAttribute a]
-> a
-> CStructureUnion a
CStruct CStructTag
a1 Maybe Ident
a2 (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f)) Maybe [CDeclaration a]
a3) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CAttribute a]
a4)
              (a -> b
_f a
a5)

instance Annotated CStructureUnion where
        annotation :: forall a. CStructureUnion a -> a
annotation (CStruct CStructTag
_ Maybe Ident
_ Maybe [CDeclaration a]
_ [CAttribute a]
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CStructureUnion a -> CStructureUnion a
amap a -> a
f (CStruct CStructTag
a_1 Maybe Ident
a_2 Maybe [CDeclaration a]
a_3 [CAttribute a]
a_4 a
a_5)
          = forall a.
CStructTag
-> Maybe Ident
-> Maybe [CDeclaration a]
-> [CAttribute a]
-> a
-> CStructureUnion a
CStruct CStructTag
a_1 Maybe Ident
a_2 Maybe [CDeclaration a]
a_3 [CAttribute a]
a_4 (a -> a
f a
a_5)

instance CNode t1 => CNode (CEnumeration t1) where
        nodeInfo :: CEnumeration t1 -> NodeInfo
nodeInfo (CEnum Maybe Ident
_ Maybe [(Ident, Maybe (CExpression t1))]
_ [CAttribute t1]
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CEnumeration t1) where
        posOf :: CEnumeration t1 -> Position
posOf CEnumeration t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CEnumeration t1
x)

instance Functor CEnumeration where
        fmap :: forall a b. (a -> b) -> CEnumeration a -> CEnumeration b
fmap a -> b
_f (CEnum Maybe Ident
a1 Maybe [(Ident, Maybe (CExpression a))]
a2 [CAttribute a]
a3 a
a4)
          = forall a.
Maybe Ident
-> Maybe [(Ident, Maybe (CExpression a))]
-> [CAttribute a]
-> a
-> CEnumeration a
CEnum Maybe Ident
a1 (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f)))) Maybe [(Ident, Maybe (CExpression a))]
a2)
              (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CAttribute a]
a3)
              (a -> b
_f a
a4)

instance Annotated CEnumeration where
        annotation :: forall a. CEnumeration a -> a
annotation (CEnum Maybe Ident
_ Maybe [(Ident, Maybe (CExpression a))]
_ [CAttribute a]
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CEnumeration a -> CEnumeration a
amap a -> a
f (CEnum Maybe Ident
a_1 Maybe [(Ident, Maybe (CExpression a))]
a_2 [CAttribute a]
a_3 a
a_4) = forall a.
Maybe Ident
-> Maybe [(Ident, Maybe (CExpression a))]
-> [CAttribute a]
-> a
-> CEnumeration a
CEnum Maybe Ident
a_1 Maybe [(Ident, Maybe (CExpression a))]
a_2 [CAttribute a]
a_3 (a -> a
f a
a_4)

instance CNode t1 => CNode (CInitializer t1) where
        nodeInfo :: CInitializer t1 -> NodeInfo
nodeInfo (CInitExpr CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CInitList CInitializerList t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CInitializer t1) where
        posOf :: CInitializer t1 -> Position
posOf CInitializer t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CInitializer t1
x)

instance Annotated CInitializer where
        annotation :: forall a. CInitializer a -> a
annotation (CInitExpr CExpression a
_ a
n) = a
n
        annotation (CInitList CInitializerList a
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CInitializer a -> CInitializer a
amap a -> a
f (CInitExpr CExpression a
a_1 a
a_2) = forall a. CExpression a -> a -> CInitializer a
CInitExpr CExpression a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CInitList CInitializerList a
a_1 a
a_2) = forall a. CInitializerList a -> a -> CInitializer a
CInitList CInitializerList a
a_1 (a -> a
f a
a_2)

instance CNode t1 => CNode (CPartDesignator t1) where
        nodeInfo :: CPartDesignator t1 -> NodeInfo
nodeInfo (CArrDesig CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CMemberDesig Ident
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CRangeDesig CExpression t1
_ CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CPartDesignator t1) where
        posOf :: CPartDesignator t1 -> Position
posOf CPartDesignator t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CPartDesignator t1
x)

instance Functor CPartDesignator where
        fmap :: forall a b. (a -> b) -> CPartDesignator a -> CPartDesignator b
fmap a -> b
_f (CArrDesig CExpression a
a1 a
a2) = forall a. CExpression a -> a -> CPartDesignator a
CArrDesig (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (a -> b
_f a
a2)
        fmap a -> b
_f (CMemberDesig Ident
a1 a
a2) = forall a. Ident -> a -> CPartDesignator a
CMemberDesig Ident
a1 (a -> b
_f a
a2)
        fmap a -> b
_f (CRangeDesig CExpression a
a1 CExpression a
a2 a
a3)
          = forall a. CExpression a -> CExpression a -> a -> CPartDesignator a
CRangeDesig (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a2) (a -> b
_f a
a3)

instance Annotated CPartDesignator where
        annotation :: forall a. CPartDesignator a -> a
annotation (CArrDesig CExpression a
_ a
n) = a
n
        annotation (CMemberDesig Ident
_ a
n) = a
n
        annotation (CRangeDesig CExpression a
_ CExpression a
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CPartDesignator a -> CPartDesignator a
amap a -> a
f (CArrDesig CExpression a
a_1 a
a_2) = forall a. CExpression a -> a -> CPartDesignator a
CArrDesig CExpression a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CMemberDesig Ident
a_1 a
a_2) = forall a. Ident -> a -> CPartDesignator a
CMemberDesig Ident
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CRangeDesig CExpression a
a_1 CExpression a
a_2 a
a_3) = forall a. CExpression a -> CExpression a -> a -> CPartDesignator a
CRangeDesig CExpression a
a_1 CExpression a
a_2 (a -> a
f a
a_3)

instance CNode t1 => CNode (CAttribute t1) where
        nodeInfo :: CAttribute t1 -> NodeInfo
nodeInfo (CAttr Ident
_ [CExpression t1]
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CAttribute t1) where
        posOf :: CAttribute t1 -> Position
posOf CAttribute t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CAttribute t1
x)

instance Functor CAttribute where
        fmap :: forall a b. (a -> b) -> CAttribute a -> CAttribute b
fmap a -> b
_f (CAttr Ident
a1 [CExpression a]
a2 a
a3) = forall a. Ident -> [CExpression a] -> a -> CAttribute a
CAttr Ident
a1 (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CExpression a]
a2) (a -> b
_f a
a3)

instance Annotated CAttribute where
        annotation :: forall a. CAttribute a -> a
annotation (CAttr Ident
_ [CExpression a]
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CAttribute a -> CAttribute a
amap a -> a
f (CAttr Ident
a_1 [CExpression a]
a_2 a
a_3) = forall a. Ident -> [CExpression a] -> a -> CAttribute a
CAttr Ident
a_1 [CExpression a]
a_2 (a -> a
f a
a_3)

instance CNode t1 => CNode (CExpression t1) where
        nodeInfo :: CExpression t1 -> NodeInfo
nodeInfo (CComma [CExpression t1]
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CAssign CAssignOp
_ CExpression t1
_ CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CCond CExpression t1
_ Maybe (CExpression t1)
_ CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CBinary CBinaryOp
_ CExpression t1
_ CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CCast CDeclaration t1
_ CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CUnary CUnaryOp
_ CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CSizeofExpr CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CSizeofType CDeclaration t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CAlignofExpr CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CAlignofType CDeclaration t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CComplexReal CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CComplexImag CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CIndex CExpression t1
_ CExpression t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CCall CExpression t1
_ [CExpression t1]
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CMember CExpression t1
_ Ident
_ Bool
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CVar Ident
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CConst CConstant t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo CConstant t1
d
        nodeInfo (CCompoundLit CDeclaration t1
_ CInitializerList t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CGenericSelection CExpression t1
_ [(Maybe (CDeclaration t1), CExpression t1)]
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CStatExpr CStatement t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CLabAddrExpr Ident
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CBuiltinExpr CBuiltinThing t1
d) = forall a. CNode a => a -> NodeInfo
nodeInfo CBuiltinThing t1
d
instance CNode t1 => Pos (CExpression t1) where
        posOf :: CExpression t1 -> Position
posOf CExpression t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CExpression t1
x)

instance Annotated CExpression where
        annotation :: forall a. CExpression a -> a
annotation (CComma [CExpression a]
_ a
n) = a
n
        annotation (CAssign CAssignOp
_ CExpression a
_ CExpression a
_ a
n) = a
n
        annotation (CCond CExpression a
_ Maybe (CExpression a)
_ CExpression a
_ a
n) = a
n
        annotation (CBinary CBinaryOp
_ CExpression a
_ CExpression a
_ a
n) = a
n
        annotation (CCast CDeclaration a
_ CExpression a
_ a
n) = a
n
        annotation (CUnary CUnaryOp
_ CExpression a
_ a
n) = a
n
        annotation (CSizeofExpr CExpression a
_ a
n) = a
n
        annotation (CSizeofType CDeclaration a
_ a
n) = a
n
        annotation (CAlignofExpr CExpression a
_ a
n) = a
n
        annotation (CAlignofType CDeclaration a
_ a
n) = a
n
        annotation (CComplexReal CExpression a
_ a
n) = a
n
        annotation (CComplexImag CExpression a
_ a
n) = a
n
        annotation (CIndex CExpression a
_ CExpression a
_ a
n) = a
n
        annotation (CCall CExpression a
_ [CExpression a]
_ a
n) = a
n
        annotation (CMember CExpression a
_ Ident
_ Bool
_ a
n) = a
n
        annotation (CVar Ident
_ a
n) = a
n
        annotation (CConst CConstant a
n) = forall (ast :: * -> *) a. Annotated ast => ast a -> a
annotation CConstant a
n
        annotation (CCompoundLit CDeclaration a
_ CInitializerList a
_ a
n) = a
n
        annotation (CGenericSelection CExpression a
_ [(Maybe (CDeclaration a), CExpression a)]
_ a
n) = a
n
        annotation (CStatExpr CStatement a
_ a
n) = a
n
        annotation (CLabAddrExpr Ident
_ a
n) = a
n
        annotation (CBuiltinExpr CBuiltinThing a
n) = forall (ast :: * -> *) a. Annotated ast => ast a -> a
annotation CBuiltinThing a
n
        amap :: forall a. (a -> a) -> CExpression a -> CExpression a
amap a -> a
f (CComma [CExpression a]
a_1 a
a_2) = forall a. [CExpression a] -> a -> CExpression a
CComma [CExpression a]
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CAssign CAssignOp
a_1 CExpression a
a_2 CExpression a
a_3 a
a_4) = forall a.
CAssignOp -> CExpression a -> CExpression a -> a -> CExpression a
CAssign CAssignOp
a_1 CExpression a
a_2 CExpression a
a_3 (a -> a
f a
a_4)
        amap a -> a
f (CCond CExpression a
a_1 Maybe (CExpression a)
a_2 CExpression a
a_3 a
a_4) = forall a.
CExpression a
-> Maybe (CExpression a) -> CExpression a -> a -> CExpression a
CCond CExpression a
a_1 Maybe (CExpression a)
a_2 CExpression a
a_3 (a -> a
f a
a_4)
        amap a -> a
f (CBinary CBinaryOp
a_1 CExpression a
a_2 CExpression a
a_3 a
a_4) = forall a.
CBinaryOp -> CExpression a -> CExpression a -> a -> CExpression a
CBinary CBinaryOp
a_1 CExpression a
a_2 CExpression a
a_3 (a -> a
f a
a_4)
        amap a -> a
f (CCast CDeclaration a
a_1 CExpression a
a_2 a
a_3) = forall a. CDeclaration a -> CExpression a -> a -> CExpression a
CCast CDeclaration a
a_1 CExpression a
a_2 (a -> a
f a
a_3)
        amap a -> a
f (CUnary CUnaryOp
a_1 CExpression a
a_2 a
a_3) = forall a. CUnaryOp -> CExpression a -> a -> CExpression a
CUnary CUnaryOp
a_1 CExpression a
a_2 (a -> a
f a
a_3)
        amap a -> a
f (CSizeofExpr CExpression a
a_1 a
a_2) = forall a. CExpression a -> a -> CExpression a
CSizeofExpr CExpression a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CSizeofType CDeclaration a
a_1 a
a_2) = forall a. CDeclaration a -> a -> CExpression a
CSizeofType CDeclaration a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CAlignofExpr CExpression a
a_1 a
a_2) = forall a. CExpression a -> a -> CExpression a
CAlignofExpr CExpression a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CAlignofType CDeclaration a
a_1 a
a_2) = forall a. CDeclaration a -> a -> CExpression a
CAlignofType CDeclaration a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CComplexReal CExpression a
a_1 a
a_2) = forall a. CExpression a -> a -> CExpression a
CComplexReal CExpression a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CComplexImag CExpression a
a_1 a
a_2) = forall a. CExpression a -> a -> CExpression a
CComplexImag CExpression a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CIndex CExpression a
a_1 CExpression a
a_2 a
a_3) = forall a. CExpression a -> CExpression a -> a -> CExpression a
CIndex CExpression a
a_1 CExpression a
a_2 (a -> a
f a
a_3)
        amap a -> a
f (CCall CExpression a
a_1 [CExpression a]
a_2 a
a_3) = forall a. CExpression a -> [CExpression a] -> a -> CExpression a
CCall CExpression a
a_1 [CExpression a]
a_2 (a -> a
f a
a_3)
        amap a -> a
f (CMember CExpression a
a_1 Ident
a_2 Bool
a_3 a
a_4) = forall a. CExpression a -> Ident -> Bool -> a -> CExpression a
CMember CExpression a
a_1 Ident
a_2 Bool
a_3 (a -> a
f a
a_4)
        amap a -> a
f (CVar Ident
a_1 a
a_2) = forall a. Ident -> a -> CExpression a
CVar Ident
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CConst CConstant a
n) = forall a. CConstant a -> CExpression a
CConst (forall (ast :: * -> *) a.
Annotated ast =>
(a -> a) -> ast a -> ast a
amap a -> a
f CConstant a
n)
        amap a -> a
f (CCompoundLit CDeclaration a
a_1 CInitializerList a
a_2 a
a_3) = forall a.
CDeclaration a -> CInitializerList a -> a -> CExpression a
CCompoundLit CDeclaration a
a_1 CInitializerList a
a_2 (a -> a
f a
a_3)
        amap a -> a
f (CGenericSelection CExpression a
a_1 [(Maybe (CDeclaration a), CExpression a)]
a_2 a
a_3)
          = forall a.
CExpression a
-> [(Maybe (CDeclaration a), CExpression a)] -> a -> CExpression a
CGenericSelection CExpression a
a_1 [(Maybe (CDeclaration a), CExpression a)]
a_2 (a -> a
f a
a_3)
        amap a -> a
f (CStatExpr CStatement a
a_1 a
a_2) = forall a. CStatement a -> a -> CExpression a
CStatExpr CStatement a
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CLabAddrExpr Ident
a_1 a
a_2) = forall a. Ident -> a -> CExpression a
CLabAddrExpr Ident
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CBuiltinExpr CBuiltinThing a
n) = forall a. CBuiltinThing a -> CExpression a
CBuiltinExpr (forall (ast :: * -> *) a.
Annotated ast =>
(a -> a) -> ast a -> ast a
amap a -> a
f CBuiltinThing a
n)

instance CNode t1 => CNode (CBuiltinThing t1) where
        nodeInfo :: CBuiltinThing t1 -> NodeInfo
nodeInfo (CBuiltinVaArg CExpression t1
_ CDeclaration t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CBuiltinOffsetOf CDeclaration t1
_ [CPartDesignator t1]
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CBuiltinTypesCompatible CDeclaration t1
_ CDeclaration t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CBuiltinConvertVector CExpression t1
_ CDeclaration t1
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CBuiltinThing t1) where
        posOf :: CBuiltinThing t1 -> Position
posOf CBuiltinThing t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CBuiltinThing t1
x)

instance Functor CBuiltinThing where
        fmap :: forall a b. (a -> b) -> CBuiltinThing a -> CBuiltinThing b
fmap a -> b
_f (CBuiltinVaArg CExpression a
a1 CDeclaration a
a2 a
a3)
          = forall a. CExpression a -> CDeclaration a -> a -> CBuiltinThing a
CBuiltinVaArg (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CDeclaration a
a2) (a -> b
_f a
a3)
        fmap a -> b
_f (CBuiltinOffsetOf CDeclaration a
a1 [CPartDesignator a]
a2 a
a3)
          = forall a.
CDeclaration a -> [CPartDesignator a] -> a -> CBuiltinThing a
CBuiltinOffsetOf (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CDeclaration a
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f) [CPartDesignator a]
a2) (a -> b
_f a
a3)
        fmap a -> b
_f (CBuiltinTypesCompatible CDeclaration a
a1 CDeclaration a
a2 a
a3)
          = forall a. CDeclaration a -> CDeclaration a -> a -> CBuiltinThing a
CBuiltinTypesCompatible (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CDeclaration a
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CDeclaration a
a2) (a -> b
_f a
a3)
        fmap a -> b
_f (CBuiltinConvertVector CExpression a
a1 CDeclaration a
a2 a
a3)
          = forall a. CExpression a -> CDeclaration a -> a -> CBuiltinThing a
CBuiltinConvertVector (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CExpression a
a1) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
_f CDeclaration a
a2) (a -> b
_f a
a3)

instance Annotated CBuiltinThing where
        annotation :: forall a. CBuiltinThing a -> a
annotation (CBuiltinVaArg CExpression a
_ CDeclaration a
_ a
n) = a
n
        annotation (CBuiltinOffsetOf CDeclaration a
_ [CPartDesignator a]
_ a
n) = a
n
        annotation (CBuiltinTypesCompatible CDeclaration a
_ CDeclaration a
_ a
n) = a
n
        annotation (CBuiltinConvertVector CExpression a
_ CDeclaration a
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CBuiltinThing a -> CBuiltinThing a
amap a -> a
f (CBuiltinVaArg CExpression a
a_1 CDeclaration a
a_2 a
a_3) = forall a. CExpression a -> CDeclaration a -> a -> CBuiltinThing a
CBuiltinVaArg CExpression a
a_1 CDeclaration a
a_2 (a -> a
f a
a_3)
        amap a -> a
f (CBuiltinOffsetOf CDeclaration a
a_1 [CPartDesignator a]
a_2 a
a_3)
          = forall a.
CDeclaration a -> [CPartDesignator a] -> a -> CBuiltinThing a
CBuiltinOffsetOf CDeclaration a
a_1 [CPartDesignator a]
a_2 (a -> a
f a
a_3)
        amap a -> a
f (CBuiltinTypesCompatible CDeclaration a
a_1 CDeclaration a
a_2 a
a_3)
          = forall a. CDeclaration a -> CDeclaration a -> a -> CBuiltinThing a
CBuiltinTypesCompatible CDeclaration a
a_1 CDeclaration a
a_2 (a -> a
f a
a_3)
        amap a -> a
f (CBuiltinConvertVector CExpression a
a_1 CDeclaration a
a_2 a
a_3) =
          forall a. CExpression a -> CDeclaration a -> a -> CBuiltinThing a
CBuiltinConvertVector CExpression a
a_1 CDeclaration a
a_2 (a -> a
f a
a_3)

instance CNode t1 => CNode (CConstant t1) where
        nodeInfo :: CConstant t1 -> NodeInfo
nodeInfo (CIntConst CInteger
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CCharConst CChar
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CFloatConst CFloat
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
        nodeInfo (CStrConst CString
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CConstant t1) where
        posOf :: CConstant t1 -> Position
posOf CConstant t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CConstant t1
x)

instance Functor CConstant where
        fmap :: forall a b. (a -> b) -> CConstant a -> CConstant b
fmap a -> b
_f (CIntConst CInteger
a1 a
a2) = forall a. CInteger -> a -> CConstant a
CIntConst CInteger
a1 (a -> b
_f a
a2)
        fmap a -> b
_f (CCharConst CChar
a1 a
a2) = forall a. CChar -> a -> CConstant a
CCharConst CChar
a1 (a -> b
_f a
a2)
        fmap a -> b
_f (CFloatConst CFloat
a1 a
a2) = forall a. CFloat -> a -> CConstant a
CFloatConst CFloat
a1 (a -> b
_f a
a2)
        fmap a -> b
_f (CStrConst CString
a1 a
a2) = forall a. CString -> a -> CConstant a
CStrConst CString
a1 (a -> b
_f a
a2)

instance Annotated CConstant where
        annotation :: forall a. CConstant a -> a
annotation (CIntConst CInteger
_ a
n) = a
n
        annotation (CCharConst CChar
_ a
n) = a
n
        annotation (CFloatConst CFloat
_ a
n) = a
n
        annotation (CStrConst CString
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CConstant a -> CConstant a
amap a -> a
f (CIntConst CInteger
a_1 a
a_2) = forall a. CInteger -> a -> CConstant a
CIntConst CInteger
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CCharConst CChar
a_1 a
a_2) = forall a. CChar -> a -> CConstant a
CCharConst CChar
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CFloatConst CFloat
a_1 a
a_2) = forall a. CFloat -> a -> CConstant a
CFloatConst CFloat
a_1 (a -> a
f a
a_2)
        amap a -> a
f (CStrConst CString
a_1 a
a_2) = forall a. CString -> a -> CConstant a
CStrConst CString
a_1 (a -> a
f a
a_2)

instance CNode t1 => CNode (CStringLiteral t1) where
        nodeInfo :: CStringLiteral t1 -> NodeInfo
nodeInfo (CStrLit CString
_ t1
n) = forall a. CNode a => a -> NodeInfo
nodeInfo t1
n
instance CNode t1 => Pos (CStringLiteral t1) where
        posOf :: CStringLiteral t1 -> Position
posOf CStringLiteral t1
x = forall a. Pos a => a -> Position
posOf (forall a. CNode a => a -> NodeInfo
nodeInfo CStringLiteral t1
x)

instance Functor CStringLiteral where
        fmap :: forall a b. (a -> b) -> CStringLiteral a -> CStringLiteral b
fmap a -> b
_f (CStrLit CString
a1 a
a2) = forall a. CString -> a -> CStringLiteral a
CStrLit CString
a1 (a -> b
_f a
a2)

instance Annotated CStringLiteral where
        annotation :: forall a. CStringLiteral a -> a
annotation (CStrLit CString
_ a
n) = a
n
        amap :: forall a. (a -> a) -> CStringLiteral a -> CStringLiteral a
amap a -> a
f (CStrLit CString
a_1 a
a_2) = forall a. CString -> a -> CStringLiteral a
CStrLit CString
a_1 (a -> a
f a
a_2)
-- GENERATED STOP