Grammar of C++ Declarators

declarator-list:

init-declarator
declarator-list ,   init-declarator

init-declarator:

ms-modifier-listopt declarator  initializeropt

declarator:

dname
ptr-operator  declarator
declarator ( argument-declaration-list ) cv-mod-listopt
declarator constant-expressionopt ]
( declarator )

cv-mod-list:

cv-qualifier  cv-mod-listopt

ptr-operator:

ms-modifier-listopt * cv-qualifier-listopt
ms-modifier-listopt & cv-qualifier-listopt
ms-modifier-listopt complete-class-name :: * cv-qualifier-listopt

cv-qualifier-list:

cv-qualifier  cv-qualifier-listopt

cv-qualifier:

const
volatile

dname:

name
class-name
~  class-name
typedef-name
qualified-type-name

type-name:

type-specifier-list  ms-modifier-listopt abstract-declaratoropt

type-specifier-list:

type-specifier  type-specifier-listopt

abstract-declarator:

ptr-operator  ms-modifier-listopt  abstract-declaratoropt
abstract-declaratoropt ( argument-declaration-list ) cv-qualifier-listopt
abstract-declaratoropt [ constant-expressionopt ]
( ms-modifier-listopt abstract-declarator )

argument-declaration-list:

arg-declaration-listopt . . .opt
arg-declaration-list ,  . . .

arg-declaration-list:

argument-declaration
arg-declaration-list  , argument-declaration

argument-declaration:

decl-specifiers  ms-modifier-listopt declarator
decl-specifiers  ms-modifier-listopt declarator = expression
decl-specifiers  ms-modifier-listopt abstract-declaratoropt
decl-specifiers  ms-modifier-listopt abstract-declaratoropt = expression

function-definition:

decl-specifiersopt ms-modifier-listopt declarator  ctor-initializeropt fct-body

fct-body:

compound-statement

initializer:

= expression
=  {  initializer-list ,opt }
( expression-list )

initializer-list:

expression
initializer-list , expression
{ initializer-list ,opt }