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

Safe Haskell | None
Language | Haskell2010

Language.C.Analysis.TypeCheck

Synopsis

- pType :: Type -> String
- typeErrorOnLeft :: MonadCError m => NodeInfo -> Either String a -> m a
- typeError :: MonadCError m => NodeInfo -> String -> m a
- notFound :: Ident -> Either String a
- checkScalar' :: MonadCError m => NodeInfo -> Type -> m ()
- checkIntegral' :: MonadCError m => NodeInfo -> Type -> m ()
- assignCompatible' :: MonadCError m => NodeInfo -> CAssignOp -> Type -> Type -> m ()
- binopType' :: MonadCError m => NodeInfo -> CBinaryOp -> Type -> Type -> m Type
- conditionalType' :: MonadCError m => NodeInfo -> Type -> Type -> m Type
- checkScalar :: Type -> Either String ()
- checkIntegral :: Type -> Either String ()
- constType :: (MonadCError m, MonadName m) => CConst -> m Type
- compatible :: Type -> Type -> Either String ()
- compositeType :: Type -> Type -> Either String Type
- compositeSize :: ArraySize -> ArraySize -> Either String ArraySize
- sizeEqual :: CExpr -> CExpr -> Bool
- mergeAttrs :: Attributes -> Attributes -> Attributes
- compositeParamDecl :: ParamDecl -> ParamDecl -> Either String ParamDecl
- compositeParamDecl' :: (VarDecl -> NodeInfo -> ParamDecl) -> VarDecl -> VarDecl -> NodeInfo -> Either String ParamDecl
- compositeVarDecl :: VarDecl -> VarDecl -> Either String VarDecl
- compositeDeclAttrs :: DeclAttrs -> DeclAttrs -> DeclAttrs
- castCompatible :: Type -> Type -> Either String ()
- assignCompatible :: CAssignOp -> Type -> Type -> Either String ()
- binopType :: CBinaryOp -> Type -> Type -> Either String Type
- conditionalType :: Type -> Type -> Either String Type
- derefType :: Type -> Either String Type
- varAddrType :: IdentDecl -> Either String Type
- fieldType :: (MonadCError m, MonadSymtab m) => NodeInfo -> Ident -> Type -> m Type
- tagMembers :: (MonadCError m, MonadSymtab m) => NodeInfo -> TagDef -> m [(Ident, Type)]
- expandAnonymous :: (MonadCError m, MonadSymtab m) => NodeInfo -> (VarName, Type) -> m [(Ident, Type)]
- lookupSUE :: (MonadCError m, MonadSymtab m) => NodeInfo -> SUERef -> m TagDef
- deepTypeAttrs :: (MonadCError m, MonadSymtab m) => Type -> m Attributes
- typeDefAttrs :: (MonadCError m, MonadSymtab m) => NodeInfo -> Ident -> m Attributes
- sueAttrs :: (MonadCError m, MonadSymtab m) => NodeInfo -> SUERef -> m Attributes

# Documentation

pType :: Type -> String Source #

typeErrorOnLeft :: MonadCError m => NodeInfo -> Either String a -> m a Source #

typeError :: MonadCError m => NodeInfo -> String -> m a Source #

notFound :: Ident -> Either String a Source #

checkScalar' :: MonadCError m => NodeInfo -> Type -> m () Source #

checkIntegral' :: MonadCError m => NodeInfo -> Type -> m () Source #

assignCompatible' :: MonadCError m => NodeInfo -> CAssignOp -> Type -> Type -> m () Source #

binopType' :: MonadCError m => NodeInfo -> CBinaryOp -> Type -> Type -> m Type Source #

conditionalType' :: MonadCError m => NodeInfo -> Type -> Type -> m Type Source #

checkScalar :: Type -> Either String () Source #

checkIntegral :: Type -> Either String () Source #

constType :: (MonadCError m, MonadName m) => CConst -> m Type Source #

Determine the type of a constant.

compatible :: Type -> Type -> Either String () Source #

Determine whether two types are compatible.

compositeType :: Type -> Type -> Either String Type Source #

Determine the composite type of two compatible types.

compositeSize :: ArraySize -> ArraySize -> Either String ArraySize Source #

sizeEqual :: CExpr -> CExpr -> Bool Source #

mergeAttrs :: Attributes -> Attributes -> Attributes Source #

compositeParamDecl :: ParamDecl -> ParamDecl -> Either String ParamDecl Source #

compositeParamDecl' :: (VarDecl -> NodeInfo -> ParamDecl) -> VarDecl -> VarDecl -> NodeInfo -> Either String ParamDecl Source #

compositeVarDecl :: VarDecl -> VarDecl -> Either String VarDecl Source #

compositeDeclAttrs :: DeclAttrs -> DeclAttrs -> DeclAttrs Source #

castCompatible :: Type -> Type -> Either String () Source #

assignCompatible :: CAssignOp -> Type -> Type -> Either String () Source #

Determine whether two types are compatible in an assignment expression.

binopType :: CBinaryOp -> Type -> Type -> Either String Type Source #

Determine the type of a binary operation.

conditionalType :: Type -> Type -> Either String Type Source #

Determine the type of a conditional expression.

derefType :: Type -> Either String Type Source #

varAddrType :: IdentDecl -> Either String Type Source #

fieldType :: (MonadCError m, MonadSymtab m) => NodeInfo -> Ident -> Type -> m Type Source #

Get the type of field `m` of type `t`

tagMembers :: (MonadCError m, MonadSymtab m) => NodeInfo -> TagDef -> m [(Ident, Type)] Source #

Get all members of a struct, union, or enum, with their types. Collapse fields of anonymous members.

expandAnonymous :: (MonadCError m, MonadSymtab m) => NodeInfo -> (VarName, Type) -> m [(Ident, Type)] Source #

Expand an anonymous composite type into a list of member names and their associated types.

lookupSUE :: (MonadCError m, MonadSymtab m) => NodeInfo -> SUERef -> m TagDef Source #

deepTypeAttrs :: (MonadCError m, MonadSymtab m) => Type -> m Attributes Source #

typeDefAttrs :: (MonadCError m, MonadSymtab m) => NodeInfo -> Ident -> m Attributes Source #

sueAttrs :: (MonadCError m, MonadSymtab m) => NodeInfo -> SUERef -> m Attributes Source #