pub enum Expression {
Show 42 variants Unary(OperatorNameBox<Expression>), Binary(OperatorNameBox<Expression>, Box<Expression>), Ternary(OperatorNameBox<Expression>, Box<Expression>, Box<Expression>), PrefixInc(Box<Expression>), PrefixDec(Box<Expression>), Call(Box<Expression>, Vec<Expression>), ConversionOne(TypeHandleBox<Expression>), ConversionMany(TypeHandleVec<Expression>), ConversionBraced(TypeHandleVec<Expression>), BracedInitList(Box<Expression>), New(Vec<Expression>, TypeHandleOption<Initializer>), GlobalNew(Vec<Expression>, TypeHandleOption<Initializer>), NewArray(Vec<Expression>, TypeHandleOption<Initializer>), GlobalNewArray(Vec<Expression>, TypeHandleOption<Initializer>), Delete(Box<Expression>), GlobalDelete(Box<Expression>), DeleteArray(Box<Expression>), GlobalDeleteArray(Box<Expression>), DynamicCast(TypeHandleBox<Expression>), StaticCast(TypeHandleBox<Expression>), ConstCast(TypeHandleBox<Expression>), ReinterpretCast(TypeHandleBox<Expression>), TypeidType(TypeHandle), TypeidExpr(Box<Expression>), SizeofType(TypeHandle), SizeofExpr(Box<Expression>), AlignofType(TypeHandle), AlignofExpr(Box<Expression>), Noexcept(Box<Expression>), TemplateParam(TemplateParam), FunctionParam(FunctionParam), Member(Box<Expression>, MemberName), DerefMember(Box<Expression>, MemberName), PointerToMember(Box<Expression>, Box<Expression>), SizeofTemplatePack(TemplateParam), SizeofFunctionPack(FunctionParam), SizeofCapturedTemplatePack(Vec<TemplateArg>), PackExpansion(Box<Expression>), Throw(Box<Expression>), Rethrow, UnresolvedName(UnresolvedName), Primary(ExprPrimary),
}
Expand description

The <expression> production.

 <expression> ::= <unary operator-name> <expression>
              ::= <binary operator-name> <expression> <expression>
              ::= <ternary operator-name> <expression> <expression> <expression>
              ::= pp_ <expression>                             # prefix ++
              ::= mm_ <expression>                             # prefix --
              ::= cl <expression>+ E                           # expression (expr-list), call
              ::= cv <type> <expression>                       # type (expression), conversion with one argument
              ::= cv <type> _ <expression>* E                  # type (expr-list), conversion with other than one argument
              ::= tl <type> <expression>* E                    # type {expr-list}, conversion with braced-init-list argument
              ::= il <expression> E                            # {expr-list}, braced-init-list in any other context
              ::= [gs] nw <expression>* _ <type> E             # new (expr-list) type
              ::= [gs] nw <expression>* _ <type> <initializer> # new (expr-list) type (init)
              ::= [gs] na <expression>* _ <type> E             # new[] (expr-list) type
              ::= [gs] na <expression>* _ <type> <initializer> # new[] (expr-list) type (init)
              ::= [gs] dl <expression>                         # delete expression
              ::= [gs] da <expression>                         # delete[] expression
              ::= dc <type> <expression>                       # dynamic_cast<type> (expression)
              ::= sc <type> <expression>                       # static_cast<type> (expression)
              ::= cc <type> <expression>                       # const_cast<type> (expression)
              ::= rc <type> <expression>                       # reinterpret_cast<type> (expression)
              ::= ti <type>                                    # typeid (type)
              ::= te <expression>                              # typeid (expression)
              ::= st <type>                                    # sizeof (type)
              ::= sz <expression>                              # sizeof (expression)
              ::= at <type>                                    # alignof (type)
              ::= az <expression>                              # alignof (expression)
              ::= nx <expression>                              # noexcept (expression)
              ::= <template-param>
              ::= <function-param>
              ::= dt <expression> <unresolved-name>            # expr.name
              ::= pt <expression> <unresolved-name>            # expr->name
              ::= ds <expression> <expression>                 # expr.*expr
              ::= sZ <template-param>                          # sizeof...(T), size of a template parameter pack
              ::= sZ <function-param>                          # sizeof...(parameter), size of a function parameter pack
              ::= sP <template-arg>* E                         # sizeof...(T), size of a captured template parameter pack from an alias template
              ::= sp <expression>                              # expression..., pack expansion
              ::= tw <expression>                              # throw expression
              ::= tr                                           # throw with no operand (rethrow)
              ::= <unresolved-name>                            # f(p), N::f(p), ::f(p),
              ::= <expr-primary>

Variants§

§

Unary(OperatorNameBox<Expression>)

A unary operator expression.

§

Binary(OperatorNameBox<Expression>, Box<Expression>)

A binary operator expression.

§

Ternary(OperatorNameBox<Expression>, Box<Expression>, Box<Expression>)

A ternary operator expression.

§

PrefixInc(Box<Expression>)

A prefix ++.

§

PrefixDec(Box<Expression>)

A prefix --.

§

Call(Box<Expression>, Vec<Expression>)

A call with functor and arguments.

§

ConversionOne(TypeHandleBox<Expression>)

A type conversion with one argument.

§

ConversionMany(TypeHandleVec<Expression>)

A type conversion with many arguments.

§

ConversionBraced(TypeHandleVec<Expression>)

A type conversion with many arguments.

§

BracedInitList(Box<Expression>)

A braced init list expression.

§

New(Vec<Expression>, TypeHandleOption<Initializer>)

The new operator.

§

GlobalNew(Vec<Expression>, TypeHandleOption<Initializer>)

The global ::new operator.

§

NewArray(Vec<Expression>, TypeHandleOption<Initializer>)

The new[] operator.

§

GlobalNewArray(Vec<Expression>, TypeHandleOption<Initializer>)

The global ::new[] operator.

§

Delete(Box<Expression>)

The delete operator.

§

GlobalDelete(Box<Expression>)

The global ::delete operator.

§

DeleteArray(Box<Expression>)

The delete[] operator.

§

GlobalDeleteArray(Box<Expression>)

The global ::delete[] operator.

§

DynamicCast(TypeHandleBox<Expression>)

dynamic_cast<type> (expression)

§

StaticCast(TypeHandleBox<Expression>)

static_cast<type> (expression)

§

ConstCast(TypeHandleBox<Expression>)

const_cast<type> (expression)

§

ReinterpretCast(TypeHandleBox<Expression>)

reinterpret_cast<type> (expression)

§

TypeidType(TypeHandle)

typeid (type)

§

TypeidExpr(Box<Expression>)

typeid (expression)

§

SizeofType(TypeHandle)

sizeof (type)

§

SizeofExpr(Box<Expression>)

sizeof (expression)

§

AlignofType(TypeHandle)

alignof (type)

§

AlignofExpr(Box<Expression>)

alignof (expression)

§

Noexcept(Box<Expression>)

noexcept (expression)

§

TemplateParam(TemplateParam)

A named template parameter.

§

FunctionParam(FunctionParam)

A function parameter.

§

Member(Box<Expression>, MemberName)

expr.name

§

DerefMember(Box<Expression>, MemberName)

expr->name

§

PointerToMember(Box<Expression>, Box<Expression>)

expr.*expr

§

SizeofTemplatePack(TemplateParam)

sizeof...(T), size of a template parameter pack.

§

SizeofFunctionPack(FunctionParam)

sizeof...(parameter), size of a function parameter pack.

§

SizeofCapturedTemplatePack(Vec<TemplateArg>)

sizeof...(T), size of a captured template parameter pack from an alias template.

§

PackExpansion(Box<Expression>)

expression..., pack expansion.

§

Throw(Box<Expression>)

throw expression

§

Rethrow

throw with no operand

§

UnresolvedName(UnresolvedName)

f(p), N::f(p), ::f(p), freestanding dependent name (e.g., T::x), objectless nonstatic member reference.

§

Primary(ExprPrimary)

An <expr-primary> production.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.