Function dmd.cparse.CParser.cparseDeclarator
C11 6.7.6 Parse a declarator (including function definitions).
AST .Type cparseDeclarator
(
CParser . DTR declarator,
AST .Type tbase,
out Identifier pident,
ref CParser . Specifier specifier
);
declarator
pointer (opt) direct-declarator
direct-declarator : identifier ( declarator ) direct-declarator [ type-qualifier-list (opt) assignment-expression (opt) ] direct-declarator [ static type-qualifier-list (opt) assignment-expression ] direct-declarator [ type-qualifier-list static assignment-expression (opt) ] direct-declarator [ type-qualifier-list (opt) * ] direct-declarator ( parameter-type-list ) direct-declarator ( identifier-list (opt) )
pointer : * type-qualifier-list (opt) * type-qualifier-list (opt) pointer
type-qualifier-list : type-qualifier type-qualifier-list type-qualifier
parameter-type-list : parameter-list parameter-list , ...
parameter-list : parameter-declaration parameter-list , parameter-declaration
parameter-declaration : declaration-specifiers declarator declaration-specifiers abstract-declarator (opt)
identifier-list : identifier identifier-list , identifier
Parameters
Name | Description |
---|---|
declarator | declarator kind |
tbase | base type to start with |
pident | set to Identifier if there is one, null if not |
specifier | specifiers in and out |
Returns
type declared. If a TypeFunction is returned, this.symbols is the symbol table for the parameter-type-list, which will contain any declared struct, union or enum tags.