|
Language.C.Analysis.DeclAnalysis | Portability | ghc | Stability | alpha | Maintainer | benedikt.huber@gmail.com |
|
|
|
|
|
Description |
This module performs the analysis of declarations and the translation of
type specifications in the AST.
|
|
Synopsis |
|
|
|
|
Translating types
|
|
|
get the type of a type declaration
A type declaration T may appear in thre forms:
typeof(T) - as abstract declarator in a function prototype, as in f(int)
- in a declaration without declarators, as in struct x { int a } ;
Currently, analyseTypeDecl is exlusively used for analysing types for GNU's typeof(T).
We move attributes to the type, as they have no meaning for the abstract declarator
|
|
|
translate a type
|
|
|
translate a type without (syntactic) indirections
Due to the GNU typeof extension and typeDefs, this can be an arbitrary type
|
|
|
Mapping from num type specs to C types (C99 6.7.2-2), ignoring the complex qualifier.
|
|
|
|
|
|
|
convert old style parameters
This requires matching parameter names and declarations, as in the following example:
int f(d,c,a,b)
char a,*b;
int c;
{ }
is converted to
int f(int d, int c, char a, char* b)
TODO: This could be moved to syntax, as it operates on the AST only
|
|
Dissecting type specs
|
|
|
|
|
Constructors | NoBaseType | | BaseChar | | BaseInt | | BaseFloat | | BaseDouble | |
|
|
|
|
|
|
|
Constructors | NoSizeMod | | ShortMod | | LongMod | | LongLongMod | |
|
|
|
|
|
|
|
|
|
|
|
|
Constructors | NoStorageSpec | | AutoSpec | | RegSpec | | ThreadSpec | | StaticSpec Bool | | ExternSpec Bool | |
|
|
|
|
|
Helpers
|
|
|
|
|
|
translate __attribute__ annotations
TODO: This is a unwrap and wrap stub
|
|
|
construct a name for a variable
TODO: more or less bogus
|
|
|
|
|
|
Produced by Haddock version 2.6.1 |