Sdílet prostřednictvím


Shrnutí deklarací

declaration:
declaration-specifiersattribute-seqopt 1 init-declarator-listopt ;
static_assert-declaration

declaration-specifiers:
storage-class-specifierdeclaration-specifiersvolit
type-specifierdeclaration-specifiersvolit
type-qualifierdeclaration-specifiersvolit
function-specifierdeclaration-specifiersvolit
alignment-specifierdeclaration-specifiersvolit

attribute-seq1:
attribute1 attribute-seqopt 1

attribute1, 2: jeden z
__asm __based __cdecl __clrcall __fastcall __inline __stdcall __thiscall __vectorcall

init-declarator-list:
init-declarator
init-declarator-list , init-declarator

init-declarator:
declarator
declarator = initializer

storage-class-specifier:
auto
extern
register
static
_Thread_local
typedef
__declspec( extended-decl-modifier-seq )1

extended-decl-modifier-seq1:
extended-decl-modifiervolit
extended-decl-modifier-seq extended-decl-modifier

extended-decl-modifier1:
thread
naked
dllimport
dllexport

type-specifier:
void
char
short
int
__int81
__int161
__int321
__int641
long
float
double
signed
unsigned
_Bool
_Complex
atomic-type-specifier
struct-or-union-specifier
enum-specifier
typedef-name

struct-or-union-specifier:
struct-or-unionidentifiervolit { struct-declaration-list }
struct-or-union identifier

struct-or-union:
struct
union

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

struct-declaration:
specifier-qualifier-liststruct-declarator-listvolit ;
static_assert-declaration

specifier-qualifier-list:
type-specifierspecifier-qualifier-listvolit
type-qualifierspecifier-qualifier-listvolit
alignment-specifierspecifier-qualifier-listvolit

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

struct-declarator:
declarator
declaratorvolit : constant-expression

enum-specifier:
enumidentifiervolit { enumerator-list }
enumidentifiervolit { enumerator-list , }
enum identifier

enumerator-list:
enumerator
enumerator-list , enumerator

enumerator:
enumeration-constant
enumeration-constant = constant-expression

atomic-type-specifier:
_Atomic ( type-name )

type-qualifier:
const
restrict
volatile
_Atomic

function-specifier:
inline
_Noreturn

alignment-specifier:
_Alignas ( type-name )
_Alignas ( constant-expression )

declarator:
pointervolit direct-declarator

direct-declarator:
identifier
( declarator )
direct-declarator[ type-qualifier-listopt opt assignment-expression ]
direct-declarator[ static type-qualifier-listvolit assignment-expression ]
direct-declarator [ type-qualifier-list static assignment-expression ]
direct-declarator[ type-qualifier-listvolit * ]
direct-declarator ( parameter-type-list )
direct-declarator( identifier-listopt )3

pointer:
*type-qualifier-listvolit
*type-qualifier-listvolit 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-specifiersabstract-declaratorvolit

identifier-list: /* Pro deklarátor starého stylu */
identifier
identifier-list , identifier

type-name:
specifier-qualifier-listabstract-declaratorvolit

abstract-declarator:
pointer
pointervolit direct-abstract-declarator

direct-abstract-declarator:
( abstract-declarator )
direct-abstract-declarator[ type-qualifier-listopt opt assignment-expression ]
direct-abstract-declarator[ static type-qualifier-listvolit assignment-expression ]
direct-abstract-declarator [ type-qualifier-list static assignment-expression ]
direct-abstract-declarator[ type-qualifier-listvolit * ]
direct-abstract-declaratoropt opt ( parameter-type-list )

typedef-name:
identifier

initializer:
assignment-expression
{ initializer-list }
{ initializer-list , }

initializer-list:
designationvolit initializer
initializer-list, designationvolit initializer

designation:
designator-list =

designator-list:
designator
designator-list designator

designator:
[ constant-expression ]
. identifier

static_assert-declaration:
_Static_assert ( constant-expression , string-literal ) ;

1 Tento gramatický prvek je specifický pro Microsoft.
2 Další informace o těchtoprvch __asm__clrcall__stdcall__based__fastcall__thiscall__cdecl__inline__vectorcall
3 Tento styl je zastaralý.

Viz také

Konvence volání
Gramatika struktury frází
Zastaralé konvence volání