language-objc-0.4.2.8: Analysis and generation of Objective C code

Safe HaskellNone

Language.ObjC.Analysis.TypeUtils

Contents

Synopsis

Constructors

integral :: IntType -> TypeSource

Constructor for a simple integral type.

floating :: FloatType -> TypeSource

Constructor for a simple floating-point type.

simplePtr :: Type -> TypeSource

A simple pointer with no qualifiers

size_tType :: TypeSource

The type returned by sizeof (size_t). For now, this is just int.

ptrDiffType :: TypeSource

The type of pointer differences (ptrdiff_t). For now, this is just int.

boolType :: TypeSource

The type of comparisons/guards. This is always just int.

voidType :: TypeSource

Simple void type.

voidPtr :: TypeSource

An unqualified void pointer.

constVoidPtr :: TypeSource

A const-qualified void pointer.

charPtr :: TypeSource

An unqualified char pointer.

constCharPtr :: TypeSource

A const-qualified char pointer.

stringType :: TypeSource

The type of a constant string.

valistType :: TypeSource

The builtin type of variable-length argument lists.

Classifiers

isIntegralType :: Type -> BoolSource

Check whether a type is an integral type. This includes enum types. This function does not attempt to resolve typedef types.

isFloatingType :: Type -> BoolSource

Check whether a type is a floating-point numeric type. This function does not attempt to resolve typedef types.

isPointerType :: Type -> BoolSource

Check whether a type is an pointer type. This includes array types. This function does not attempt to resolve typedef types.

isScalarType :: Type -> BoolSource

Check whether a type is a scalar type. Scalar types include arithmetic types and pointer types.

isFunctionType :: Type -> BoolSource

return True if the given type is a function type

Result is undefined in the presence of undefined typeDefs

typeQuals :: Type -> TypeQualsSource

Return the qualifiers of a type.

typeAttrs :: Type -> AttributesSource

Return the attributes of a type.

baseType :: Type -> TypeSource

Return the base type of a pointer or array type. It is an error to call this function with a type that is not in one of those two categories.

derefTypeDef :: Type -> TypeSource

resolve typedefs, if possible

deepDerefTypeDef :: Type -> TypeSource

Attempt to remove all references to typedef types from a given type. Note that this does not dereference the types of structure or union fields, so there are still cases where further dereferencing is needed.

Other utilities