Next: Declarations
Up: Syntactic structure
Previous: Syntactic structure
primary_expression:
identifier /
constant /
StringSeq /
'(' expression ')' .
StringSeq:
string_literal /
StringSeq string_literal .
This macro is defined in definitions 3, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, and 27.
This macro is invoked in definition 6.
Section 6.1.4 of the standard states that any sequence of adjacent
character string literal tokens are concatenated into a single sequence
when translated.
We use the StringSeq phrase here to formalize that specification.
postfix_expression:
primary_expression /
postfix_expression '[' expression ']' /
postfix_expression '(' argument_expression_list_opt ')' /
postfix_expression '.' identifier /
postfix_expression '->' identifier /
postfix_expression '++' /
postfix_expression '-' .
argument_expression_list:
assignment_expression /
argument_expression_list ',' assignment_expression.
unary_expression:
postfix_expression /
'++' unary_expression /
'-' unary_expression /
'&' cast_expression /
unary_operator cast_expression /
'sizeof' unary_expression /
'sizeof' '(' type_name ')'.
unary_operator:
'*' / '+' / '-' / 'SPMtilde;' / '!' .
This macro is defined in definitions 3, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, and 27.
This macro is invoked in definition 6.
Section 6.2.2.1 of the standard says that when the unary & operator
is applied to an lvalue, the result is the address of the object
designated by the lvalue.
If any other unary operator is applied to an lvalue, that lvalue is
converted to the value stored in the designated object.
Thus the semantics of the unary & operator differ significantly from
those of the other unary operators.
Semantic analysis is simplified if the two contexts are distinguished.
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.
This macro is defined in definitions 3, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, and 27.
This macro is invoked in definition 6.
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:
'=' / '*=' / '/=' / '%=' / '+=' / '-=' / '«=' / '»=' / '&=' / '^=' / '|=' .
expression:
assignment_expression /
expression ',' assignment_expression .
constant_expression:
conditional_expression .
This macro is defined in definitions 3, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, and 27.
This macro is invoked in definition 6.
Next: Declarations
Up: Syntactic structure
Previous: Syntactic structure
2008-08-30