View source code
Display the source code in dmd/cparse.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

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

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

Authors

Walter Bright

License

Boost License 1.0