language-c-0.8.3: Analysis and generation of C code
Safe HaskellNone
LanguageHaskell98

Language.C.Analysis.TypeCheck

Synopsis

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 :: 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.

sizeEqual :: CExpr -> CExpr -> Bool #

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

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.