声明摘要Summary of Declarations

declarationdeclaration:
declaration-specifiers attribute-seq opt init-declarator-listopt;declaration-specifiers attribute-seq opt init-declarator-listopt;

/* attribute-seq 为 Microsoft 专用 //* *attribute-seq is Microsoft Specific */

declaration-specifiersdeclaration-specifiers:
storage-class-specifier declaration-specifiersoptstorage-class-specifier declaration-specifiersopt

type-specifier declaration-specifiersopttype-specifier declaration-specifiersopt

type-qualifier declaration-specifiersopttype-qualifier declaration-specifiersopt

attribute-seq: /* attribute-seq 为 Microsoft 专用 */attribute-seq : /* attribute-seq is Microsoft Specific */
attribute attribute-seq optattribute attribute-seq opt

attribute:一个 /* Microsoft 专用 */attribute : one of /* Microsoft Specific */

__asm__asm __clrcall__clrcall __stdcall__stdcall
__based__based __fastcall__fastcall __thiscall__thiscall
__cdecl__cdecl __inline__inline __vectorcall__vectorcall

init-declarator-listinit-declarator-list:
init-declaratorinit-declarator

init-declarator-list , init-declaratorinit-declarator-list , init-declarator

init-declaratorinit-declarator:
declaratordeclarator

declarator = initializer /* 用于标量初始化 */declarator = initializer /* For scalar initialization */

storage-class-specifierstorage-class-specifier:
autoauto

registerregister

staticstatic

externextern

typedeftypedef

__declspec ( extended-decl-modifier-seq ) /* Microsoft 专用 */__declspec ( extended-decl-modifier-seq ) /* Microsoft Specific */

type-specifiertype-specifier:
voidvoid

charchar

shortshort

intint

__int8 /* Microsoft 专用 */__int8 /* Microsoft Specific */

__int16 /* Microsoft 专用 */__int16 /* Microsoft Specific */

__int32 /* Microsoft 专用 */__int32 /* Microsoft Specific */

__int64 /* Microsoft 专用 */__int64 /* Microsoft Specific */

longlong

floatfloat

doubledouble

signedsigned

unsignedunsigned

struct-or-union-specifierstruct-or-union-specifier

enum-specifierenum-specifier

typedef-nametypedef-name

type-qualifier:type-qualifier:
constconst

volatile

declaratordeclarator:
pointeropt direct-declaratorpointeropt direct-declarator

direct-declaratordirect-declarator:
identifieridentifier

( declarator )( declarator )

direct-declarator [ constant-expression opt]direct-declarator [ constant-expression opt]

direct-declarator ( parameter-type-list ) /* 新样式声明符 */direct-declarator ( parameter-type-list ) /* New-style declarator */

direct-declarator ( identifier-listopt) /* Obsolete-style declarator */direct-declarator ( identifier-listopt) /* Obsolete-style declarator */

pointerpointer:
\* type-qualifier-listopt\* type-qualifier-listopt

\* type-qualifier-listoptpointer\* type-qualifier-listoptpointer

parameter-type-list: /* 参数列表 */parameter-type-list: /* The parameter list */
parameter-listparameter-list

parameter-list , ...parameter-list , ...

parameter-list:parameter-list:
parameter-declarationparameter-declaration

parameter-list , parameter-declarationparameter-list , parameter-declaration

type-qualifier-list:type-qualifier-list:
type-qualifiertype-qualifier

type-qualifier-list type-qualifiertype-qualifier-list type-qualifier

enum-specifierenum-specifier:
enum identifieropt{ enumerator-list }enum identifieropt{ enumerator-list }

enum identifierenum identifier

enumerator-listenumerator-list:
enumeratorenumerator

enumerator-list , enumeratorenumerator-list , enumerator

enumeratorenumerator:
enumeration-constantenumeration-constant

enumeration-constant = constant-expressionenumeration-constant = constant-expression

enumeration-constantenumeration-constant:
identifieridentifier

struct-or-union-specifier:struct-or-union-specifier:
struct-or-union identifieropt{ struct-declaration-list } struct-or-union identifierstruct-or-union identifieropt{ struct-declaration-list } struct-or-union identifier

struct-or-union:struct-or-union:
structstruct

unionunion

struct-declaration-list:struct-declaration-list:
struct-declarationstruct-declaration

struct-declaration-list struct-declarationstruct-declaration-list struct-declaration

struct-declaration:struct-declaration:
specifier-qualifier-list struct-declarator-list ;specifier-qualifier-list struct-declarator-list ;

specifier-qualifier-list:specifier-qualifier-list:
type-specifier specifier-qualifier-listopttype-specifier specifier-qualifier-listopt

type-qualifier specifier-qualifier-listopttype-qualifier specifier-qualifier-listopt

struct-declarator-list:struct-declarator-list:
struct-declarator struct-declarator-list , struct-declaratorstruct-declarator struct-declarator-list , struct-declarator

struct-declarator:struct-declarator:
declaratordeclarator

type-specifier declaratoropt: constant-expressiontype-specifier declaratoropt: constant-expression

parameter-declaration:parameter-declaration:
declaration-specifiers declarator /* 已命名的声明符 */declaration-specifiers declarator /* Named declarator */

declaration-specifiers abstract-declaratoropt/\* Anonymous declarator */declaration-specifiers abstract-declaratoropt/\* Anonymous declarator */

identifier-list/\* 用于旧式声明符 * /identifier-list: /\* For old-style declarator * /
identifieridentifier

identifier-list , identifieridentifier-list , identifier

abstract-declarator/\* 用于匿名声明符 */abstract-declarator: /\* Used with anonymous declarators */
pointerpointer

pointeroptdirect-abstract-declaratorpointeroptdirect-abstract-declarator

direct-abstract-declaratordirect-abstract-declarator:
( abstract-declarator )( abstract-declarator )

direct-abstract-declaratoropt[ constant-expressionopt]direct-abstract-declaratoropt[ constant-expressionopt]

direct-abstract-declaratoropt( parameter-type-list opt)direct-abstract-declaratoropt( parameter-type-list opt)

initializerinitializer:
assignment-expressionassignment-expression

{ initializer-list } /* 用于聚合初始化 */{ initializer-list } /* For aggregate initialization */

{ initializer-list , }{ initializer-list , }

initializer-listinitializer-list:
initializerinitializer

initializer-list , initializerinitializer-list , initializer

type-nametype-name:
specifier-qualifier-list abstract-declaratoroptspecifier-qualifier-list abstract-declaratoropt

typedef-nametypedef-name:
identifieridentifier

extended-decl-modifier-seq:/* Microsoft 专用 */extended-decl-modifier-seq:/* Microsoft Specific */
extended-decl-modifieroptextended-decl-modifieropt

extended-decl-modifier-seq extended-decl-modifierextended-decl-modifier-seq extended-decl-modifier

extended-decl-modifier: /* Microsoft 专用 */extended-decl-modifier: /* Microsoft Specific */
threadthread

nakednaked

dllimportdllimport

dllexport

另请参阅See Also

调用约定 Calling Conventions
短语结构语法 Phrase Structure Grammar
已过时调用约定Obsolete Calling Conventions