Language.C.Analysis.TypeCheck

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

Safe Haskell | None
Language | Haskell98

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

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

Determine the type of a constant.

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

Determine whether two types are compatible.

compositeType :: Type -> Type -> Either String Type

Determine the composite type of two compatible types.

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 ()

Determine whether two types are compatible in an assignment expression.

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

Determine the type of a binary operation.

conditionalType :: Type -> Type -> Either String Type

Determine the type of a conditional expression.

derefType :: Type -> Either String Type

varAddrType :: IdentDecl -> Either String Type

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

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

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

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)]

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

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