language-c-0.10.1: Analysis and generation of C code

Copyright | (c) 2008 Benedikt Huber
License | BSD-style
Maintainer | benedikt.huber@gmail.com
Stability | alpha
Portability | ghc
Safe Haskell | None
Language | Haskell2010

Language.C.Analysis.SemRep

Contents

- Sums of tags and identifiers
- Global definitions
- Events for visitors
- Declarations and definitions
- Declaration attributes
- Types
- Variable names
- Attributes (STUB, not yet analyzed)
- Statements and Expressions (STUB, aliases to Syntax)

Description

This module contains definitions for representing C translation units. In contrast to `AST`, the representation tries to express the semantics of of a translation unit.

Synopsis

- data TagDef
  - = CompDef CompType
  - | EnumDef EnumType
- typeOfTagDef :: TagDef -> TypeName
- class Declaration n where
  - getVarDecl :: n -> VarDecl
- declIdent :: Declaration n => n -> Ident
- declName :: Declaration n => n -> VarName
- declType :: Declaration n => n -> Type
- declAttrs :: Declaration n => n -> DeclAttrs
- data IdentDecl
  - = Declaration Decl
  - | ObjectDef ObjDef
  - | FunctionDef FunDef
  - | EnumeratorDef Enumerator
- objKindDescr :: IdentDecl -> String
- splitIdentDecls :: Bool -> Map Ident IdentDecl -> (Map Ident Decl, (Map Ident Enumerator, Map Ident ObjDef, Map Ident FunDef))
- data GlobalDecls = GlobalDecls {
  - gObjs :: Map Ident IdentDecl
  - gTags :: Map SUERef TagDef
  - gTypeDefs :: Map Ident TypeDef
  }
- emptyGlobalDecls :: GlobalDecls
- filterGlobalDecls :: (DeclEvent -> Bool) -> GlobalDecls -> GlobalDecls
- mergeGlobalDecls :: GlobalDecls -> GlobalDecls -> GlobalDecls
- data DeclEvent
  - = TagEvent TagDef
  - | DeclEvent IdentDecl
  - | ParamEvent ParamDecl
  - | LocalEvent IdentDecl
  - | TypeDefEvent TypeDef
  - | AsmEvent AsmBlock
- data Decl = Decl VarDecl NodeInfo
- data ObjDef = ObjDef VarDecl (Maybe Initializer) NodeInfo
- isTentative :: ObjDef -> Bool
- data FunDef = FunDef VarDecl Stmt NodeInfo
- data ParamDecl
  - = ParamDecl VarDecl NodeInfo
  - | AbstractParamDecl VarDecl NodeInfo
- data MemberDecl
  - = MemberDecl VarDecl (Maybe Expr) NodeInfo
  - | AnonBitField Type Expr NodeInfo
- data TypeDef = TypeDef Ident Type Attributes NodeInfo
- identOfTypeDef :: TypeDef -> Ident
- data VarDecl = VarDecl VarName DeclAttrs Type
- data DeclAttrs = DeclAttrs FunctionAttrs Storage Attributes
- isExtDecl :: Declaration n => n -> Bool
- data FunctionAttrs = FunctionAttrs {
  - isInline :: Bool
  - isNoreturn :: Bool
  }
- functionAttrs :: Declaration d => d -> FunctionAttrs
- noFunctionAttrs :: FunctionAttrs
- data Storage
  - = NoStorage
  - | Auto Register
  - | Static Linkage ThreadLocal
  - | FunLinkage Linkage
- declStorage :: Declaration d => d -> Storage
- type ThreadLocal = Bool
- type Register = Bool
- data Linkage
  - = NoLinkage
  - | InternalLinkage
  - | ExternalLinkage
- hasLinkage :: Storage -> Bool
- declLinkage :: Declaration d => d -> Linkage
- data Type
  - = DirectType TypeName TypeQuals Attributes
  - | PtrType Type TypeQuals Attributes
  - | ArrayType Type ArraySize TypeQuals Attributes
  - | FunctionType FunType Attributes
  - | TypeDefType TypeDefRef TypeQuals Attributes
- data FunType
  - = FunType Type [ParamDecl] Bool
  - | FunTypeIncomplete Type
- data ArraySize
  - = UnknownArraySize Bool
  - | ArraySize Bool Expr
- data TypeDefRef = TypeDefRef Ident Type NodeInfo
- data TypeName
  - = TyVoid
  - | TyIntegral IntType
  - | TyFloating FloatType
  - | TyComplex FloatType
  - | TyComp CompTypeRef
  - | TyEnum EnumTypeRef
  - | TyBuiltin BuiltinType
- data BuiltinType
  - = TyVaList
  - | TyAny
- data IntType
  - = TyBool
  - | TyChar
  - | TySChar
  - | TyUChar
  - | TyShort
  - | TyUShort
  - | TyInt
  - | TyUInt
  - | TyInt128
  - | TyUInt128
  - | TyLong
  - | TyULong
  - | TyLLong
  - | TyULLong
- data FloatType
  - = TyFloat
  - | TyDouble
  - | TyLDouble
  - | TyBFloat16
  - | TyFloatN Int Bool
- class HasSUERef a where
  - sueRef :: a -> SUERef
- class HasCompTyKind a where
  - compTag :: a -> CompTyKind
- data CompTypeRef = CompTypeRef SUERef CompTyKind NodeInfo
- data CompType = CompType SUERef CompTyKind [MemberDecl] Attributes NodeInfo
- typeOfCompDef :: CompType -> TypeName
- data CompTyKind
  - = StructTag
  - | UnionTag
- data EnumTypeRef = EnumTypeRef SUERef NodeInfo
- data EnumType = EnumType SUERef [Enumerator] Attributes NodeInfo
- typeOfEnumDef :: EnumType -> TypeName
- data Enumerator = Enumerator Ident Expr EnumType NodeInfo
- data TypeQuals = TypeQuals {
  - constant :: Bool
  - volatile :: Bool
  - restrict :: Bool
  - atomic :: Bool
  - nullable :: Bool
  - nonnull :: Bool
  - clrdonly :: Bool
  - clwronly :: Bool
  }
- noTypeQuals :: TypeQuals
- mergeTypeQuals :: TypeQuals -> TypeQuals -> TypeQuals
- data VarName
  - = VarName Ident (Maybe AsmName)
  - | NoName
- identOfVarName :: VarName -> Ident
- isNoName :: VarName -> Bool
- type AsmName = CStrLit
- data Attr = Attr Ident [Expr] NodeInfo
- type Attributes = [Attr]
- noAttributes :: Attributes
- mergeAttributes :: Attributes -> Attributes -> Attributes
- type Stmt = CStat
- type Expr = CExpr
- type Initializer = CInit
- type AsmBlock = CStrLit

# Sums of tags and identifiers

data TagDef Source #

Composite type definitions (tags)

Constructors

CompDef CompType |
EnumDef EnumType |

#### Instances

Instances details

Data TagDef Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TagDef -> c TagDef Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TagDef Source #

toConstr :: TagDef -> Constr Source #

dataTypeOf :: TagDef -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TagDef) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TagDef) Source #

gmapT :: (forall b. Data b => b -> b) -> TagDef -> TagDef Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TagDef -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TagDef -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> TagDef -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TagDef -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TagDef -> m TagDef Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TagDef -> m TagDef Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TagDef -> m TagDef Source #

Show TagDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> TagDef -> ShowS Source # show :: TagDef -> String Source # showList :: [TagDef] -> ShowS Source #
HasSUERef TagDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods sueRef :: TagDef -> SUERef Source #
CNode TagDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: TagDef -> NodeInfo Source #
Pos TagDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: TagDef -> Position Source #
Pretty TagDef Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: TagDef -> Doc Source # prettyPrec :: Int -> TagDef -> Doc Source #

typeOfTagDef :: TagDef -> TypeName Source #

return the type corresponding to a tag definition

class Declaration n where Source #

All datatypes aggregating a declaration are instances of `Declaration`

Methods

getVarDecl :: n -> VarDecl Source #

get the name, type and declaration attributes of a declaration or definition

#### Instances

Instances details

Declaration Decl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: Decl -> VarDecl Source #
Declaration Enumerator Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: Enumerator -> VarDecl Source #
Declaration FunDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: FunDef -> VarDecl Source #
Declaration IdentDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: IdentDecl -> VarDecl Source #
Declaration MemberDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: MemberDecl -> VarDecl Source #
Declaration ObjDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: ObjDef -> VarDecl Source #
Declaration ParamDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: ParamDecl -> VarDecl Source #
Declaration VarDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: VarDecl -> VarDecl Source #
(Declaration a, Declaration b) => Declaration (Either a b) Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: Either a b -> VarDecl Source #

declIdent :: Declaration n => n -> Ident Source #

get the variable identifier of a declaration (only safe if the the declaration is known to have a name)

declName :: Declaration n => n -> VarName Source #

get the variable name of a `Declaration`

declType :: Declaration n => n -> Type Source #

get the type of a `Declaration`

declAttrs :: Declaration n => n -> DeclAttrs Source #

get the declaration attributes of a `Declaration`

data IdentDecl Source #

identifiers, typedefs and enumeration constants (namespace sum)

Constructors

Declaration Decl | object or function declaration
ObjectDef ObjDef | object definition
FunctionDef FunDef | function definition
EnumeratorDef Enumerator | definition of an enumerator

#### Instances

Instances details

Data IdentDecl Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IdentDecl -> c IdentDecl Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IdentDecl Source #

toConstr :: IdentDecl -> Constr Source #

dataTypeOf :: IdentDecl -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c IdentDecl) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IdentDecl) Source #

gmapT :: (forall b. Data b => b -> b) -> IdentDecl -> IdentDecl Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IdentDecl -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IdentDecl -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> IdentDecl -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> IdentDecl -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> IdentDecl -> m IdentDecl Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IdentDecl -> m IdentDecl Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IdentDecl -> m IdentDecl Source #

Show IdentDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> IdentDecl -> ShowS Source # show :: IdentDecl -> String Source # showList :: [IdentDecl] -> ShowS Source #
Declaration IdentDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: IdentDecl -> VarDecl Source #
CNode IdentDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: IdentDecl -> NodeInfo Source #
Pos IdentDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: IdentDecl -> Position Source #
Pretty IdentDecl Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: IdentDecl -> Doc Source # prettyPrec :: Int -> IdentDecl -> Doc Source #

objKindDescr :: IdentDecl -> String Source #

textual description of the kind of an object

splitIdentDecls :: Bool -> Map Ident IdentDecl -> (Map Ident Decl, (Map Ident Enumerator, Map Ident ObjDef, Map Ident FunDef)) Source #

`splitIdentDecls includeAllDecls` splits a map of object, function and enumerator declarations and definitions into one map holding declarations, and three maps for object definitions, enumerator definitions and function definitions. If `includeAllDecls` is `True` all declarations are present in the first map, otherwise only those where no corresponding definition is available.

# Global definitions

data GlobalDecls Source #

global declaration/definition table returned by the analysis

Constructors

GlobalDecls |

Fields

- gObjs :: Map Ident IdentDecl
- gTags :: Map SUERef TagDef
- gTypeDefs :: Map Ident TypeDef

#### Instances

Instances details

Pretty GlobalDecls Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: GlobalDecls -> Doc Source # prettyPrec :: Int -> GlobalDecls -> Doc Source #

emptyGlobalDecls :: GlobalDecls Source #

empty global declaration table

filterGlobalDecls :: (DeclEvent -> Bool) -> GlobalDecls -> GlobalDecls Source #

filter global declarations

mergeGlobalDecls :: GlobalDecls -> GlobalDecls -> GlobalDecls Source #

merge global declarations

# Events for visitors

data DeclEvent Source #

Declaration events

Those events are reported to callbacks, which are executed during the traversal.

Constructors

TagEvent TagDef | file-scope struct/union/enum event
DeclEvent IdentDecl | file-scope declaration or definition
ParamEvent ParamDecl | parameter declaration
LocalEvent IdentDecl | local variable declaration or definition
TypeDefEvent TypeDef | a type definition
AsmEvent AsmBlock | assembler block

#### Instances

Instances details

CNode DeclEvent Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: DeclEvent -> NodeInfo Source #
Pos DeclEvent Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: DeclEvent -> Position Source #

# Declarations and definitions

data Decl Source #

Declarations, which aren't definitions

Constructors

Decl VarDecl NodeInfo |

#### Instances

Instances details

Data Decl Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Decl -> c Decl Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Decl Source #

toConstr :: Decl -> Constr Source #

dataTypeOf :: Decl -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Decl) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Decl) Source #

gmapT :: (forall b. Data b => b -> b) -> Decl -> Decl Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Decl -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Decl -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Decl -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Decl -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Decl -> m Decl Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Decl -> m Decl Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Decl -> m Decl Source #

Show Decl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> Decl -> ShowS Source # show :: Decl -> String Source # showList :: [Decl] -> ShowS Source #
Declaration Decl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: Decl -> VarDecl Source #
CNode Decl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: Decl -> NodeInfo Source #
Pos Decl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: Decl -> Position Source #
Pretty Decl Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: Decl -> Doc Source # prettyPrec :: Int -> Decl -> Doc Source #

data ObjDef Source #

Object Definitions

An object definition is a declaration together with an initializer.

If the initializer is missing, it is a tentative definition, i.e. a definition which might be overriden later on.

Constructors

ObjDef VarDecl (Maybe Initializer) NodeInfo |

#### Instances

Instances details

Data ObjDef Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ObjDef -> c ObjDef Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ObjDef Source #

toConstr :: ObjDef -> Constr Source #

dataTypeOf :: ObjDef -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ObjDef) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ObjDef) Source #

gmapT :: (forall b. Data b => b -> b) -> ObjDef -> ObjDef Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ObjDef -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ObjDef -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> ObjDef -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ObjDef -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ObjDef -> m ObjDef Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ObjDef -> m ObjDef Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ObjDef -> m ObjDef Source #

Show ObjDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> ObjDef -> ShowS Source # show :: ObjDef -> String Source # showList :: [ObjDef] -> ShowS Source #
Declaration ObjDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: ObjDef -> VarDecl Source #
CNode ObjDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: ObjDef -> NodeInfo Source #
Pos ObjDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: ObjDef -> Position Source #
Pretty ObjDef Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: ObjDef -> Doc Source # prettyPrec :: Int -> ObjDef -> Doc Source #

isTentative :: ObjDef -> Bool Source #

Returns `True` if the given object definition is tentative.

data FunDef Source #

Function definitions

A function definition is a declaration together with a statement (the function body).

Constructors

FunDef VarDecl Stmt NodeInfo |

#### Instances

Instances details

Data FunDef Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FunDef -> c FunDef Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FunDef Source #

toConstr :: FunDef -> Constr Source #

dataTypeOf :: FunDef -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FunDef) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FunDef) Source #

gmapT :: (forall b. Data b => b -> b) -> FunDef -> FunDef Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FunDef -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FunDef -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> FunDef -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> FunDef -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> FunDef -> m FunDef Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FunDef -> m FunDef Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FunDef -> m FunDef Source #

Show FunDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> FunDef -> ShowS Source # show :: FunDef -> String Source # showList :: [FunDef] -> ShowS Source #
Declaration FunDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: FunDef -> VarDecl Source #
CNode FunDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: FunDef -> NodeInfo Source #
Pos FunDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: FunDef -> Position Source #
Pretty FunDef Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: FunDef -> Doc Source # prettyPrec :: Int -> FunDef -> Doc Source #

data ParamDecl Source #

Parameter declaration

Constructors

ParamDecl VarDecl NodeInfo |
AbstractParamDecl VarDecl NodeInfo |

#### Instances

Instances details

Data ParamDecl Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ParamDecl -> c ParamDecl Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ParamDecl Source #

toConstr :: ParamDecl -> Constr Source #

dataTypeOf :: ParamDecl -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ParamDecl) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ParamDecl) Source #

gmapT :: (forall b. Data b => b -> b) -> ParamDecl -> ParamDecl Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ParamDecl -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ParamDecl -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> ParamDecl -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ParamDecl -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ParamDecl -> m ParamDecl Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ParamDecl -> m ParamDecl Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ParamDecl -> m ParamDecl Source #

Show ParamDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> ParamDecl -> ShowS Source # show :: ParamDecl -> String Source # showList :: [ParamDecl] -> ShowS Source #
Declaration ParamDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: ParamDecl -> VarDecl Source #
CNode ParamDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: ParamDecl -> NodeInfo Source #
Pos ParamDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: ParamDecl -> Position Source #
Pretty ParamDecl Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: ParamDecl -> Doc Source # prettyPrec :: Int -> ParamDecl -> Doc Source #

data MemberDecl Source #

Struct/Union member declaration

Constructors

MemberDecl VarDecl (Maybe Expr) NodeInfo

    MemberDecl vardecl bitfieldsize node

AnonBitField Type Expr NodeInfo

    AnonBitField typ size

#### Instances

Instances details

Data MemberDecl Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MemberDecl -> c MemberDecl Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MemberDecl Source #

toConstr :: MemberDecl -> Constr Source #

dataTypeOf :: MemberDecl -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MemberDecl) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MemberDecl) Source #

gmapT :: (forall b. Data b => b -> b) -> MemberDecl -> MemberDecl Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MemberDecl -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MemberDecl -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> MemberDecl -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MemberDecl -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MemberDecl -> m MemberDecl Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MemberDecl -> m MemberDecl Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MemberDecl -> m MemberDecl Source #

Show MemberDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> MemberDecl -> ShowS Source # show :: MemberDecl -> String Source # showList :: [MemberDecl] -> ShowS Source #
Declaration MemberDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: MemberDecl -> VarDecl Source #
CNode MemberDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: MemberDecl -> NodeInfo Source #
Pos MemberDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: MemberDecl -> Position Source #
Pretty MemberDecl Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: MemberDecl -> Doc Source # prettyPrec :: Int -> MemberDecl -> Doc Source #

data TypeDef Source #

`typedef` definitions.

The identifier is a new name for the given type.

Constructors

TypeDef Ident Type Attributes NodeInfo |

#### Instances

Instances details

Data TypeDef Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TypeDef -> c TypeDef Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TypeDef Source #

toConstr :: TypeDef -> Constr Source #

dataTypeOf :: TypeDef -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TypeDef) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TypeDef) Source #

gmapT :: (forall b. Data b => b -> b) -> TypeDef -> TypeDef Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TypeDef -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TypeDef -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> TypeDef -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TypeDef -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TypeDef -> m TypeDef Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TypeDef -> m TypeDef Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TypeDef -> m TypeDef Source #

Show TypeDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> TypeDef -> ShowS Source # show :: TypeDef -> String Source # showList :: [TypeDef] -> ShowS Source #
CNode TypeDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: TypeDef -> NodeInfo Source #
Pos TypeDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: TypeDef -> Position Source #
Pretty TypeDef Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: TypeDef -> Doc Source # prettyPrec :: Int -> TypeDef -> Doc Source #

identOfTypeDef :: TypeDef -> Ident Source #

return the idenitifier of a `typedef`

data VarDecl Source #

Generic variable declarations

Constructors

VarDecl VarName DeclAttrs Type |

#### Instances

Instances details

Data VarDecl Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> VarDecl -> c VarDecl Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c VarDecl Source #

toConstr :: VarDecl -> Constr Source #

dataTypeOf :: VarDecl -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c VarDecl) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c VarDecl) Source #

gmapT :: (forall b. Data b => b -> b) -> VarDecl -> VarDecl Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> VarDecl -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> VarDecl -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> VarDecl -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> VarDecl -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> VarDecl -> m VarDecl Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> VarDecl -> m VarDecl Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> VarDecl -> m VarDecl Source #

Show VarDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> VarDecl -> ShowS Source # show :: VarDecl -> String Source # showList :: [VarDecl] -> ShowS Source #
Declaration VarDecl Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: VarDecl -> VarDecl Source #
Pretty VarDecl Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: VarDecl -> Doc Source # prettyPrec :: Int -> VarDecl -> Doc Source #

# Declaration attributes

data DeclAttrs Source #

Declaration attributes of the form `DeclAttrs isInlineFunction storage linkage attrs`

They specify the storage and linkage of a declared object.

Constructors

DeclAttrs FunctionAttrs Storage Attributes

    DeclAttrs fspecs storage attrs

#### Instances

Instances details

Data DeclAttrs Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DeclAttrs -> c DeclAttrs Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DeclAttrs Source #

toConstr :: DeclAttrs -> Constr Source #

dataTypeOf :: DeclAttrs -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DeclAttrs) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DeclAttrs) Source #

gmapT :: (forall b. Data b => b -> b) -> DeclAttrs -> DeclAttrs Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DeclAttrs -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DeclAttrs -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DeclAttrs -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DeclAttrs -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DeclAttrs -> m DeclAttrs Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DeclAttrs -> m DeclAttrs Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DeclAttrs -> m DeclAttrs Source #

Show DeclAttrs Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> DeclAttrs -> ShowS Source # show :: DeclAttrs -> String Source # showList :: [DeclAttrs] -> ShowS Source #
Pretty DeclAttrs Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: DeclAttrs -> Doc Source # prettyPrec :: Int -> DeclAttrs -> Doc Source #

isExtDecl :: Declaration n => n -> Bool Source #

data FunctionAttrs Source #

Constructors

FunctionAttrs |

Fields

- isInline :: Bool
- isNoreturn :: Bool

#### Instances

Instances details

Data FunctionAttrs Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FunctionAttrs -> c FunctionAttrs Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FunctionAttrs Source #

toConstr :: FunctionAttrs -> Constr Source #

dataTypeOf :: FunctionAttrs -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FunctionAttrs) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FunctionAttrs) Source #

gmapT :: (forall b. Data b => b -> b) -> FunctionAttrs -> FunctionAttrs Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FunctionAttrs -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FunctionAttrs -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> FunctionAttrs -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> FunctionAttrs -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> FunctionAttrs -> m FunctionAttrs Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FunctionAttrs -> m FunctionAttrs Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FunctionAttrs -> m FunctionAttrs Source #

Show FunctionAttrs Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> FunctionAttrs -> ShowS Source # show :: FunctionAttrs -> String Source # showList :: [FunctionAttrs] -> ShowS Source #
Eq FunctionAttrs Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods (==) :: FunctionAttrs -> FunctionAttrs -> Bool Source # (/=) :: FunctionAttrs -> FunctionAttrs -> Bool Source #
Ord FunctionAttrs Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

compare :: FunctionAttrs -> FunctionAttrs -> Ordering Source #

(<) :: FunctionAttrs -> FunctionAttrs -> Bool Source #

(<=) :: FunctionAttrs -> FunctionAttrs -> Bool Source #

(>) :: FunctionAttrs -> FunctionAttrs -> Bool Source #

(>=) :: FunctionAttrs -> FunctionAttrs -> Bool Source #

max :: FunctionAttrs -> FunctionAttrs -> FunctionAttrs Source #

min :: FunctionAttrs -> FunctionAttrs -> FunctionAttrs Source #

Pretty FunctionAttrs Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: FunctionAttrs -> Doc Source # prettyPrec :: Int -> FunctionAttrs -> Doc Source #

functionAttrs :: Declaration d => d -> FunctionAttrs Source #

get the `function attributes' of a declaration

noFunctionAttrs :: FunctionAttrs Source #

data Storage Source #

Storage duration and linkage of a variable

Constructors

NoStorage | no storage
Auto Register | automatic storage (optional: register)
Static Linkage ThreadLocal | static storage, linkage spec and thread local specifier (gnu c)
FunLinkage Linkage | function, either internal or external linkage

#### Instances

Instances details

Data Storage Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Storage -> c Storage Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Storage Source #

toConstr :: Storage -> Constr Source #

dataTypeOf :: Storage -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Storage) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Storage) Source #

gmapT :: (forall b. Data b => b -> b) -> Storage -> Storage Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Storage -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Storage -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Storage -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Storage -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Storage -> m Storage Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Storage -> m Storage Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Storage -> m Storage Source #

Show Storage Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> Storage -> ShowS Source # show :: Storage -> String Source # showList :: [Storage] -> ShowS Source #
Eq Storage Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods (==) :: Storage -> Storage -> Bool Source # (/=) :: Storage -> Storage -> Bool Source #
Ord Storage Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods compare :: Storage -> Storage -> Ordering Source # (<) :: Storage -> Storage -> Bool Source # (<=) :: Storage -> Storage -> Bool Source # (>) :: Storage -> Storage -> Bool Source # (>=) :: Storage -> Storage -> Bool Source # max :: Storage -> Storage -> Storage Source # min :: Storage -> Storage -> Storage Source #
Pretty Storage Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: Storage -> Doc Source # prettyPrec :: Int -> Storage -> Doc Source #

declStorage :: Declaration d => d -> Storage Source #

get the `Storage` of a declaration

type ThreadLocal = Bool Source #

type Register = Bool Source #

data Linkage Source #

Linkage: Either no linkage, internal to the translation unit or external

Constructors

NoLinkage |
InternalLinkage |
ExternalLinkage |

#### Instances

Instances details

Data Linkage Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Linkage -> c Linkage Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Linkage Source #

toConstr :: Linkage -> Constr Source #

dataTypeOf :: Linkage -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Linkage) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Linkage) Source #

gmapT :: (forall b. Data b => b -> b) -> Linkage -> Linkage Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Linkage -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Linkage -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Linkage -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Linkage -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Linkage -> m Linkage Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Linkage -> m Linkage Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Linkage -> m Linkage Source #

Show Linkage Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> Linkage -> ShowS Source # show :: Linkage -> String Source # showList :: [Linkage] -> ShowS Source #
Eq Linkage Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods (==) :: Linkage -> Linkage -> Bool Source # (/=) :: Linkage -> Linkage -> Bool Source #
Ord Linkage Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods compare :: Linkage -> Linkage -> Ordering Source # (<) :: Linkage -> Linkage -> Bool Source # (<=) :: Linkage -> Linkage -> Bool Source # (>) :: Linkage -> Linkage -> Bool Source # (>=) :: Linkage -> Linkage -> Bool Source # max :: Linkage -> Linkage -> Linkage Source # min :: Linkage -> Linkage -> Linkage Source #
Pretty Linkage Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: Linkage -> Doc Source # prettyPrec :: Int -> Linkage -> Doc Source #

hasLinkage :: Storage -> Bool Source #

return `True` if the object has linkage

declLinkage :: Declaration d => d -> Linkage Source #

Get the linkage of a definition

# Types

data Type Source #

types of C objects

Constructors

DirectType TypeName TypeQuals Attributes | a non-derived type
PtrType Type TypeQuals Attributes | pointer type
ArrayType Type ArraySize TypeQuals Attributes | array type
FunctionType FunType Attributes | function type
TypeDefType TypeDefRef TypeQuals Attributes | a defined type

#### Instances

Instances details

Data Type Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Type -> c Type Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Type Source #

toConstr :: Type -> Constr Source #

dataTypeOf :: Type -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Type) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Type) Source #

gmapT :: (forall b. Data b => b -> b) -> Type -> Type Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Type -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Type -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Type -> m Type Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type Source #

Show Type Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> Type -> ShowS Source # show :: Type -> String Source # showList :: [Type] -> ShowS Source #
Pretty Type Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: Type -> Doc Source # prettyPrec :: Int -> Type -> Doc Source #

data FunType Source #

Function types are of the form `FunType return-type params isVariadic`.

If the parameter types aren't yet known, the function has type `FunTypeIncomplete type attrs`.

Constructors

FunType Type [ParamDecl] Bool |
FunTypeIncomplete Type |

#### Instances

Instances details

Data FunType Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FunType -> c FunType Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FunType Source #

toConstr :: FunType -> Constr Source #

dataTypeOf :: FunType -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FunType) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FunType) Source #

gmapT :: (forall b. Data b => b -> b) -> FunType -> FunType Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FunType -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FunType -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> FunType -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> FunType -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> FunType -> m FunType Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FunType -> m FunType Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FunType -> m FunType Source #

Show FunType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> FunType -> ShowS Source # show :: FunType -> String Source # showList :: [FunType] -> ShowS Source #

data ArraySize Source #

An array type may either have unknown size or a specified array size, the latter either variable or constant. Furthermore, when used as a function parameters, the size may be qualified as static. In a function prototype, the size may be `Unspecified variable size' (`[*]`).

Constructors

UnknownArraySize Bool

    UnknownArraySize is-starred

ArraySize Bool Expr

    FixedSizeArray is-static size-expr

#### Instances

Instances details

Data ArraySize Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ArraySize -> c ArraySize Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ArraySize Source #

toConstr :: ArraySize -> Constr Source #

dataTypeOf :: ArraySize -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ArraySize) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ArraySize) Source #

gmapT :: (forall b. Data b => b -> b) -> ArraySize -> ArraySize Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ArraySize -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ArraySize -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> ArraySize -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ArraySize -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ArraySize -> m ArraySize Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ArraySize -> m ArraySize Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ArraySize -> m ArraySize Source #

Show ArraySize Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> ArraySize -> ShowS Source # show :: ArraySize -> String Source # showList :: [ArraySize] -> ShowS Source #

data TypeDefRef Source #

typdef references If the actual type is known, it is attached for convenience

Constructors

TypeDefRef Ident Type NodeInfo |

#### Instances

Instances details

Data TypeDefRef Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TypeDefRef -> c TypeDefRef Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TypeDefRef Source #

toConstr :: TypeDefRef -> Constr Source #

dataTypeOf :: TypeDefRef -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TypeDefRef) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TypeDefRef) Source #

gmapT :: (forall b. Data b => b -> b) -> TypeDefRef -> TypeDefRef Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TypeDefRef -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TypeDefRef -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> TypeDefRef -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TypeDefRef -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TypeDefRef -> m TypeDefRef Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TypeDefRef -> m TypeDefRef Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TypeDefRef -> m TypeDefRef Source #

Show TypeDefRef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> TypeDefRef -> ShowS Source # show :: TypeDefRef -> String Source # showList :: [TypeDefRef] -> ShowS Source #
CNode TypeDefRef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: TypeDefRef -> NodeInfo Source #
Pos TypeDefRef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: TypeDefRef -> Position Source #

data TypeName Source #

normalized type representation

Constructors

TyVoid |
TyIntegral IntType |
TyFloating FloatType |
TyComplex FloatType |
TyComp CompTypeRef |
TyEnum EnumTypeRef |
TyBuiltin BuiltinType |

#### Instances

Instances details

Data TypeName Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TypeName -> c TypeName Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TypeName Source #

toConstr :: TypeName -> Constr Source #

dataTypeOf :: TypeName -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TypeName) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TypeName) Source #

gmapT :: (forall b. Data b => b -> b) -> TypeName -> TypeName Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TypeName -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TypeName -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> TypeName -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TypeName -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TypeName -> m TypeName Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TypeName -> m TypeName Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TypeName -> m TypeName Source #

Show TypeName Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> TypeName -> ShowS Source # show :: TypeName -> String Source # showList :: [TypeName] -> ShowS Source #

data BuiltinType Source #

Builtin type (va_list, anything)

Constructors

TyVaList |
TyAny |

#### Instances

Instances details

Data BuiltinType Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinType -> c BuiltinType Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BuiltinType Source #

toConstr :: BuiltinType -> Constr Source #

dataTypeOf :: BuiltinType -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BuiltinType) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BuiltinType) Source #

gmapT :: (forall b. Data b => b -> b) -> BuiltinType -> BuiltinType Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinType -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinType -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BuiltinType -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinType -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinType -> m BuiltinType Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinType -> m BuiltinType Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinType -> m BuiltinType Source #

Show BuiltinType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> BuiltinType -> ShowS Source # show :: BuiltinType -> String Source # showList :: [BuiltinType] -> ShowS Source #

data IntType Source #

integral types (C99 6.7.2.2)

Constructors

TyBool |
TyChar |
TySChar |
TyUChar |
TyShort |
TyUShort |
TyInt |
TyUInt |
TyInt128 |
TyUInt128 |
TyLong |
TyULong |
TyLLong |
TyULLong |

#### Instances

Instances details

Data IntType Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IntType -> c IntType Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IntType Source #

toConstr :: IntType -> Constr Source #

dataTypeOf :: IntType -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c IntType) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IntType) Source #

gmapT :: (forall b. Data b => b -> b) -> IntType -> IntType Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IntType -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IntType -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> IntType -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> IntType -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> IntType -> m IntType Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IntType -> m IntType Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IntType -> m IntType Source #

Show IntType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> IntType -> ShowS Source # show :: IntType -> String Source # showList :: [IntType] -> ShowS Source #
Eq IntType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods (==) :: IntType -> IntType -> Bool Source # (/=) :: IntType -> IntType -> Bool Source #
Ord IntType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods compare :: IntType -> IntType -> Ordering Source # (<) :: IntType -> IntType -> Bool Source # (<=) :: IntType -> IntType -> Bool Source # (>) :: IntType -> IntType -> Bool Source # (>=) :: IntType -> IntType -> Bool Source # max :: IntType -> IntType -> IntType Source # min :: IntType -> IntType -> IntType Source #

data FloatType Source #

floating point type (C99 6.7.2.2)

Constructors

TyFloat |
TyDouble |
TyLDouble |
TyBFloat16 |
TyFloatN Int Bool |

#### Instances

Instances details

Data FloatType Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FloatType -> c FloatType Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FloatType Source #

toConstr :: FloatType -> Constr Source #

dataTypeOf :: FloatType -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FloatType) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FloatType) Source #

gmapT :: (forall b. Data b => b -> b) -> FloatType -> FloatType Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FloatType -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FloatType -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> FloatType -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> FloatType -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> FloatType -> m FloatType Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FloatType -> m FloatType Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FloatType -> m FloatType Source #

Show FloatType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> FloatType -> ShowS Source # show :: FloatType -> String Source # showList :: [FloatType] -> ShowS Source #
Eq FloatType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods (==) :: FloatType -> FloatType -> Bool Source # (/=) :: FloatType -> FloatType -> Bool Source #
Ord FloatType Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

compare :: FloatType -> FloatType -> Ordering Source #

(<) :: FloatType -> FloatType -> Bool Source #

(<=) :: FloatType -> FloatType -> Bool Source #

(>) :: FloatType -> FloatType -> Bool Source #

(>=) :: FloatType -> FloatType -> Bool Source #

max :: FloatType -> FloatType -> FloatType Source #

min :: FloatType -> FloatType -> FloatType Source #

class HasSUERef a where Source #

accessor class : struct/union/enum names

Methods

sueRef :: a -> SUERef Source #

#### Instances

Instances details

HasSUERef TagFwdDecl Source # |
Instance details Defined in Language.C.Analysis.DefTable Methods sueRef :: TagFwdDecl -> SUERef Source #
HasSUERef CompType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods sueRef :: CompType -> SUERef Source #
HasSUERef CompTypeRef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods sueRef :: CompTypeRef -> SUERef Source #
HasSUERef EnumType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods sueRef :: EnumType -> SUERef Source #
HasSUERef EnumTypeRef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods sueRef :: EnumTypeRef -> SUERef Source #
HasSUERef TagDef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods sueRef :: TagDef -> SUERef Source #

class HasCompTyKind a where Source #

accessor class : composite type tags (struct or union)

Methods

compTag :: a -> CompTyKind Source #

#### Instances

Instances details

HasCompTyKind CompType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods compTag :: CompType -> CompTyKind Source #
HasCompTyKind CompTypeRef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods compTag :: CompTypeRef -> CompTyKind Source #

data CompTypeRef Source #

composite type declarations

Constructors

CompTypeRef SUERef CompTyKind NodeInfo |

#### Instances

Instances details

Data CompTypeRef Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CompTypeRef -> c CompTypeRef Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CompTypeRef Source #

toConstr :: CompTypeRef -> Constr Source #

dataTypeOf :: CompTypeRef -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CompTypeRef) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CompTypeRef) Source #

gmapT :: (forall b. Data b => b -> b) -> CompTypeRef -> CompTypeRef Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CompTypeRef -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CompTypeRef -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> CompTypeRef -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CompTypeRef -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CompTypeRef -> m CompTypeRef Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CompTypeRef -> m CompTypeRef Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CompTypeRef -> m CompTypeRef Source #

Show CompTypeRef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> CompTypeRef -> ShowS Source # show :: CompTypeRef -> String Source # showList :: [CompTypeRef] -> ShowS Source #
HasCompTyKind CompTypeRef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods compTag :: CompTypeRef -> CompTyKind Source #
HasSUERef CompTypeRef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods sueRef :: CompTypeRef -> SUERef Source #
CNode CompTypeRef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: CompTypeRef -> NodeInfo Source #
Pos CompTypeRef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: CompTypeRef -> Position Source #
Pretty CompTypeRef Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: CompTypeRef -> Doc Source # prettyPrec :: Int -> CompTypeRef -> Doc Source #

data CompType Source #

Composite type (struct or union).

Constructors

CompType SUERef CompTyKind [MemberDecl] Attributes NodeInfo |

#### Instances

Instances details

Data CompType Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CompType -> c CompType Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CompType Source #

toConstr :: CompType -> Constr Source #

dataTypeOf :: CompType -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CompType) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CompType) Source #

gmapT :: (forall b. Data b => b -> b) -> CompType -> CompType Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CompType -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CompType -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> CompType -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CompType -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CompType -> m CompType Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CompType -> m CompType Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CompType -> m CompType Source #

Show CompType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> CompType -> ShowS Source # show :: CompType -> String Source # showList :: [CompType] -> ShowS Source #
HasCompTyKind CompType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods compTag :: CompType -> CompTyKind Source #
HasSUERef CompType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods sueRef :: CompType -> SUERef Source #
CNode CompType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: CompType -> NodeInfo Source #
Pos CompType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: CompType -> Position Source #
Pretty CompType Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: CompType -> Doc Source # prettyPrec :: Int -> CompType -> Doc Source #

typeOfCompDef :: CompType -> TypeName Source #

return the type of a composite type definition

data CompTyKind Source #

a tag to determine wheter we refer to a `struct` or `union`, see `CompType`.

Constructors

StructTag |
UnionTag |

#### Instances

Instances details

Data CompTyKind Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CompTyKind -> c CompTyKind Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CompTyKind Source #

toConstr :: CompTyKind -> Constr Source #

dataTypeOf :: CompTyKind -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CompTyKind) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CompTyKind) Source #

gmapT :: (forall b. Data b => b -> b) -> CompTyKind -> CompTyKind Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CompTyKind -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CompTyKind -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> CompTyKind -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CompTyKind -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CompTyKind -> m CompTyKind Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CompTyKind -> m CompTyKind Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CompTyKind -> m CompTyKind Source #

Show CompTyKind Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> CompTyKind -> ShowS Source # show :: CompTyKind -> String Source # showList :: [CompTyKind] -> ShowS Source #
Eq CompTyKind Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods (==) :: CompTyKind -> CompTyKind -> Bool Source # (/=) :: CompTyKind -> CompTyKind -> Bool Source #
Ord CompTyKind Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

compare :: CompTyKind -> CompTyKind -> Ordering Source #

(<) :: CompTyKind -> CompTyKind -> Bool Source #

(<=) :: CompTyKind -> CompTyKind -> Bool Source #

(>) :: CompTyKind -> CompTyKind -> Bool Source #

(>=) :: CompTyKind -> CompTyKind -> Bool Source #

max :: CompTyKind -> CompTyKind -> CompTyKind Source #

min :: CompTyKind -> CompTyKind -> CompTyKind Source #

Pretty CompTyKind Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: CompTyKind -> Doc Source # prettyPrec :: Int -> CompTyKind -> Doc Source #

data EnumTypeRef Source #

Constructors

EnumTypeRef SUERef NodeInfo |

#### Instances

Instances details

Data EnumTypeRef Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> EnumTypeRef -> c EnumTypeRef Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c EnumTypeRef Source #

toConstr :: EnumTypeRef -> Constr Source #

dataTypeOf :: EnumTypeRef -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c EnumTypeRef) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c EnumTypeRef) Source #

gmapT :: (forall b. Data b => b -> b) -> EnumTypeRef -> EnumTypeRef Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EnumTypeRef -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EnumTypeRef -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> EnumTypeRef -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> EnumTypeRef -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> EnumTypeRef -> m EnumTypeRef Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EnumTypeRef -> m EnumTypeRef Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EnumTypeRef -> m EnumTypeRef Source #

Show EnumTypeRef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> EnumTypeRef -> ShowS Source # show :: EnumTypeRef -> String Source # showList :: [EnumTypeRef] -> ShowS Source #
HasSUERef EnumTypeRef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods sueRef :: EnumTypeRef -> SUERef Source #
CNode EnumTypeRef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: EnumTypeRef -> NodeInfo Source #
Pos EnumTypeRef Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: EnumTypeRef -> Position Source #
Pretty EnumTypeRef Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: EnumTypeRef -> Doc Source # prettyPrec :: Int -> EnumTypeRef -> Doc Source #

data EnumType Source #

Representation of C enumeration types

Constructors

EnumType SUERef [Enumerator] Attributes NodeInfo

    EnumType name enumeration-constants attrs node

#### Instances

Instances details

Data EnumType Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> EnumType -> c EnumType Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c EnumType Source #

toConstr :: EnumType -> Constr Source #

dataTypeOf :: EnumType -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c EnumType) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c EnumType) Source #

gmapT :: (forall b. Data b => b -> b) -> EnumType -> EnumType Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EnumType -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EnumType -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> EnumType -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> EnumType -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> EnumType -> m EnumType Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EnumType -> m EnumType Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EnumType -> m EnumType Source #

Show EnumType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> EnumType -> ShowS Source # show :: EnumType -> String Source # showList :: [EnumType] -> ShowS Source #
HasSUERef EnumType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods sueRef :: EnumType -> SUERef Source #
CNode EnumType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: EnumType -> NodeInfo Source #
Pos EnumType Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: EnumType -> Position Source #
Pretty EnumType Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: EnumType -> Doc Source # prettyPrec :: Int -> EnumType -> Doc Source #

typeOfEnumDef :: EnumType -> TypeName Source #

return the type of an enum definition

data Enumerator Source #

An Enumerator consists of an identifier, a constant expressions and the link to its type

Constructors

Enumerator Ident Expr EnumType NodeInfo |

#### Instances

Instances details

Data Enumerator Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Enumerator -> c Enumerator Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Enumerator Source #

toConstr :: Enumerator -> Constr Source #

dataTypeOf :: Enumerator -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Enumerator) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Enumerator) Source #

gmapT :: (forall b. Data b => b -> b) -> Enumerator -> Enumerator Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Enumerator -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Enumerator -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Enumerator -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Enumerator -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Enumerator -> m Enumerator Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Enumerator -> m Enumerator Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Enumerator -> m Enumerator Source #

Show Enumerator Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> Enumerator -> ShowS Source # show :: Enumerator -> String Source # showList :: [Enumerator] -> ShowS Source #
Declaration Enumerator Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods getVarDecl :: Enumerator -> VarDecl Source #
CNode Enumerator Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: Enumerator -> NodeInfo Source #
Pos Enumerator Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: Enumerator -> Position Source #
Pretty Enumerator Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: Enumerator -> Doc Source # prettyPrec :: Int -> Enumerator -> Doc Source #

data TypeQuals Source #

Type qualifiers: constant, volatile and restrict

Constructors

TypeQuals |

Fields

- constant :: Bool
- volatile :: Bool
- restrict :: Bool
- atomic :: Bool
- nullable :: Bool
- nonnull :: Bool
- clrdonly :: Bool
- clwronly :: Bool

#### Instances

Instances details

Data TypeQuals Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TypeQuals -> c TypeQuals Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TypeQuals Source #

toConstr :: TypeQuals -> Constr Source #

dataTypeOf :: TypeQuals -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TypeQuals) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TypeQuals) Source #

gmapT :: (forall b. Data b => b -> b) -> TypeQuals -> TypeQuals Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TypeQuals -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TypeQuals -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> TypeQuals -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TypeQuals -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TypeQuals -> m TypeQuals Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TypeQuals -> m TypeQuals Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TypeQuals -> m TypeQuals Source #

Show TypeQuals Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> TypeQuals -> ShowS Source # show :: TypeQuals -> String Source # showList :: [TypeQuals] -> ShowS Source #
Eq TypeQuals Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods (==) :: TypeQuals -> TypeQuals -> Bool Source # (/=) :: TypeQuals -> TypeQuals -> Bool Source #
Ord TypeQuals Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

compare :: TypeQuals -> TypeQuals -> Ordering Source #

(<) :: TypeQuals -> TypeQuals -> Bool Source #

(<=) :: TypeQuals -> TypeQuals -> Bool Source #

(>) :: TypeQuals -> TypeQuals -> Bool Source #

(>=) :: TypeQuals -> TypeQuals -> Bool Source #

max :: TypeQuals -> TypeQuals -> TypeQuals Source #

min :: TypeQuals -> TypeQuals -> TypeQuals Source #

Pretty TypeQuals Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: TypeQuals -> Doc Source # prettyPrec :: Int -> TypeQuals -> Doc Source #

noTypeQuals :: TypeQuals Source #

no type qualifiers

mergeTypeQuals :: TypeQuals -> TypeQuals -> TypeQuals Source #

merge (&&) two type qualifier sets

# Variable names

data VarName Source #

`VarName name assembler-name` is a name of an declared object

Constructors

VarName Ident (Maybe AsmName) |
NoName |

#### Instances

Instances details

Data VarName Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> VarName -> c VarName Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c VarName Source #

toConstr :: VarName -> Constr Source #

dataTypeOf :: VarName -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c VarName) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c VarName) Source #

gmapT :: (forall b. Data b => b -> b) -> VarName -> VarName Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> VarName -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> VarName -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> VarName -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> VarName -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> VarName -> m VarName Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> VarName -> m VarName Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> VarName -> m VarName Source #

Show VarName Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> VarName -> ShowS Source # show :: VarName -> String Source # showList :: [VarName] -> ShowS Source #
Pretty VarName Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: VarName -> Doc Source # prettyPrec :: Int -> VarName -> Doc Source #

identOfVarName :: VarName -> Ident Source #

isNoName :: VarName -> Bool Source #

type AsmName = CStrLit Source #

Assembler name (alias for `CStrLit`)

# Attributes (STUB, not yet analyzed)

data Attr Source #

`attribute` annotations

Those are of the form `Attr attribute-name attribute-parameters`, and serve as generic properties of some syntax tree elements.

Some examples:

- labels can be attributed with unused to indicate that their not used
- struct definitions can be attributed with packed to tell the compiler to use the most compact representation
- declarations can be attributed with deprecated
- function declarations can be attributes with noreturn to tell the compiler that the function will never return,
- or with const to indicate that it is a pure function

TODO: ultimatively, we want to parse attributes and represent them in a typed way

Constructors

Attr Ident [Expr] NodeInfo |

#### Instances

Instances details

Data Attr Source # |

Instance details

Defined in Language.C.Analysis.SemRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Attr -> c Attr Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Attr Source #

toConstr :: Attr -> Constr Source #

dataTypeOf :: Attr -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Attr) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Attr) Source #

gmapT :: (forall b. Data b => b -> b) -> Attr -> Attr Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Attr -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Attr -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Attr -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Attr -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Attr -> m Attr Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Attr -> m Attr Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Attr -> m Attr Source #

Show Attr Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods showsPrec :: Int -> Attr -> ShowS Source # show :: Attr -> String Source # showList :: [Attr] -> ShowS Source #
CNode Attr Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods nodeInfo :: Attr -> NodeInfo Source #
Pos Attr Source # |
Instance details Defined in Language.C.Analysis.SemRep Methods posOf :: Attr -> Position Source #
Pretty Attr Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: Attr -> Doc Source # prettyPrec :: Int -> Attr -> Doc Source #
Pretty Attributes Source # |
Instance details Defined in Language.C.Analysis.Debug Methods pretty :: Attributes -> Doc Source # prettyPrec :: Int -> Attributes -> Doc Source #

type Attributes = [Attr] Source #

noAttributes :: Attributes Source #

Empty attribute list

mergeAttributes :: Attributes -> Attributes -> Attributes Source #

Merge attribute lists TODO: currently does not remove duplicates

# Statements and Expressions (STUB, aliases to Syntax)

type Stmt = CStat Source #

`Stmt` is an alias for `CStat` (Syntax)

type Expr = CExpr Source #

`Expr` is currently an alias for `CExpr` (Syntax)

type Initializer = CInit Source #

`Initializer` is currently an alias for `CInit`.

We're planning a normalized representation, but this depends on the implementation of constant expression evaluation

type AsmBlock = CStrLit Source #

Top level assembler block (alias for `CStrLit`)