Edit

Share via


Summary of Expressions

primary-expression:
identifier
constant
string-literal
( expression )
generic-selection

generic-selection:
_Generic ( assignment-expression , generic-assoc-list )

generic-assoc-list:
generic-association
generic-assoc-list , generic-association

generic-association:
type-name : assignment-expression
default : assignment-expression

postfix-expression:
primary-expression
postfix-expression [ expression ]
postfix-expression ( argument-expression-listopt )
postfix-expression . identifier
postfix-expression -> identifier
postfix-expression ++
postfix-expression --
( type-name ) { initializer-list }
( type-name ) { initializer-list , }

argument-expression-list:
assignment-expression
argument-expression-list , assignment-expression

unary-expression:
postfix-expression
++ unary-expression
-- unary-expression
unary-operator cast-expression
sizeof unary-expression
sizeof ( type-name )_Alignof ( type-name )

unary-operator: one of
& * + - ~ !

cast-expression:
unary-expression
( type-name ) cast-expression

multiplicative-expression:
cast-expression
multiplicative-expression * cast-expression
multiplicative-expression / cast-expression
multiplicative-expression % cast-expression

additive-expression:
multiplicative-expression
additive-expression + multiplicative-expression
additive-expression - multiplicative-expression

shift-expression:
additive-expression
shift-expression << additive-expression
shift-expression >> additive-expression

relational-expression:
shift-expression
relational-expression < shift-expression
relational-expression > shift-expression
relational-expression <= shift-expression
relational-expression >= shift-expression

equality-expression:
relational-expression
equality-expression == relational-expression
equality-expression != relational-expression

AND-expression:
equality-expression
AND-expression & equality-expression

exclusive-OR-expression:
AND-expression
exclusive-OR-expression ^ AND-expression

inclusive-OR-expression:
exclusive-OR-expression
inclusive-OR-expression | exclusive-OR-expression

logical-AND-expression:
inclusive-OR-expression
logical-AND-expression && inclusive-OR-expression

logical-OR-expression:
logical-AND-expression
logical-OR-expression || logical-AND-expression

conditional-expression:
logical-OR-expression
logical-OR-expression ? expression : conditional-expression

assignment-expression:
conditional-expression
unary-expression assignment-operator assignment-expression

assignment-operator: one of
= *= /= %= += -= <<= >>= &= ^= |=

expression:
assignment-expression
expression , assignment-expression

constant-expression:
conditional-expression

See also