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

Language.C.Analysis.TypeCheck

Synopsis

Documentation

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.

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.

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.