DekGenius.com
Team LiB   Previous Section   Next Section
expression Any expression

expression ::= assignment-expr | expression , assignment-expr
constant-expr ::= conditional-expr
expr-list ::= assignment-expr | expr-list , assignment-expr
assignment-expr ::= conditional-expr | 
    logical-or-expr assignment-op assignment-expr | throw-expr
assignment-op ::= = | *= | /= | %= | += | -= | >>= | <<= | &= | and_eq | "|=" | 
    or_eq | ^= | xor_eq
throw-expr ::= throw [assignment-expr]
conditional-expr ::= logical-or-expr | logical-or-expr ? expression : assignment-expr
logical-or-expr ::= logical-and-expr | logical-or-expr "||" logical-and-expr | 
    logical-or-expr or logical-and-expr
logical-and-expr ::= inclusive-or-expr | logical-and-expr && inclusive-or-expr | 
    logical-and-expr and inclusive-or-expr
inclusive-or-expr ::= exclusive-or-expr | inclusive-or-expr "|" exclusive-or-expr | 
    inclusive-or-expr bitor exclusive-or-expr
exclusive-or-expr ::= and-expr | exclusive-or-expr ^ and-expr | 
    exclusive-or-expr xor and-expr
inclusive-or-expr ::= equality-expr | and-expr & equality-expr | 
    and-expr bitand exclusive-or-expr
equality-expr ::= relational-expr | equality-expr == relational-expr | 
    equality-expr != relational-expr | equality-expr not_eq relational-expr
relational-expr ::= shift-expr | relational-expr < shift-expr | 
    relational-expr > shift-expr | relational-expr <= shift-expr | 
    relational-expr >= shift-expr
shift-expr ::= add-expr | shift-expr << add-expr | shift-expr >> add-expr
add-expr ::= mul-expr | add-expr + mul-expr | add-expr - mul-expr
mul-expr ::= pm-expr | mul-expr * pm-expr | mul-expr / pm-expr | 
    mul-expr % pm-expr
pm-expr ::= cast-expr | pm-expr .* cast-expr | pm-expr ->* cast-expr
cast-expr ::= unary-expr | ( type-id ) cast-expr
unary-expr ::= postfix-expr | ++ cast-expr | -- cast-expr | unary-op cast-expr | 
    sizeof unary-expr | sizeof ( type-id ) | new-expr | delete-expr
postfix-expr ::= primary-expr | postfix-expr "[" expression "]" | 
    postfix-expr ( [expr-list] ) | simple-type-specifier ( [expr-list] ) | 
    typename [::] nested-name :: identifier ( [expr-list] ) | 
    typename [::] nested-name :: [template] template-id ( [expr-list] ) | 
    postfix-expr . [template] id-expr | postfix-expr -> [template] id-expr | 
    postfix-expr . pseudo-dtor-name | postfix-expr -> pseudo-dtor-name | 
    postfix-expr ++ | postfix-expr -- | const_cast < type-id > ( expression ) | 
    dynamic_cast < type-id > ( expression ) | 
    reinterpret_cast < type-id > ( expression ) | 
    static_cast < type-id > ( expression ) | typeid ( expression ) | 
    typeid ( type-id )
pseudo-dtor-name ::= [::] [nested-name ::] type-name :: ~ type-name | 
    [::] nested-name :: template template-id :: ~ type-name
primary-expr ::= literal | this | ( expression ) | id-expr

An expression represents a value and a type. See Chapter 3 for details about expressions, precedence, associativity, lvalues and rvalues, and more. Some syntax rules are presented here and in the various keyword sections. The new-expr and delete-expr rules are not duplicated here; see new and delete for details. The id-expr rules are under identifier. See Chapter 1 for information about literals.

See Also

and, and_eq, bitand, bitor, compl, const_cast, delete, dynamic_cast, identifier, new, not, not_eq, or, or_eq, reinterpret_cast, sizeof, static_cast, template, type, typeid, xor, xor_eq, Chapter 3

    Team LiB   Previous Section   Next Section