pub enum Expression {
Show 43 variants Unary(OperatorName, Box<Expression>), Binary(OperatorName, Box<Expression>, Box<Expression>), Ternary(OperatorName, Box<Expression>, Box<Expression>, Box<Expression>), PrefixInc(Box<Expression>), PrefixDec(Box<Expression>), Call(Box<Expression>, Vec<Expression>), ConversionOne(TypeHandle, Box<Expression>), ConversionMany(TypeHandle, Vec<Expression>), ConversionBraced(TypeHandle, Vec<Expression>), BracedInitList(Box<Expression>), New(Vec<Expression>, TypeHandle, Option<Initializer>), GlobalNew(Vec<Expression>, TypeHandle, Option<Initializer>), NewArray(Vec<Expression>, TypeHandle, Option<Initializer>), GlobalNewArray(Vec<Expression>, TypeHandle, Option<Initializer>), Delete(Box<Expression>), GlobalDelete(Box<Expression>), DeleteArray(Box<Expression>), GlobalDeleteArray(Box<Expression>), DynamicCast(TypeHandle, Box<Expression>), StaticCast(TypeHandle, Box<Expression>), ConstCast(TypeHandle, Box<Expression>), ReinterpretCast(TypeHandle, Box<Expression>), TypeidType(TypeHandle), TypeidExpr(Box<Expression>), SizeofType(TypeHandle), SizeofExpr(Box<Expression>), AlignofType(TypeHandle), AlignofExpr(Box<Expression>), Noexcept(Box<Expression>), Subobject(SubobjectExpr), 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)
              ::= so <subobject-expr>
              ::= <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),
                                                               # freestanding dependent name (e.g., T::x),
                                                               # objectless nonstatic member reference
              ::= <expr-primary>

Variants§

§

Unary(OperatorName, Box<Expression>)

A unary operator expression.

§

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

A binary operator expression.

§

Ternary(OperatorName, Box<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(TypeHandle, Box<Expression>)

A type conversion with one argument.

§

ConversionMany(TypeHandle, Vec<Expression>)

A type conversion with many arguments.

§

ConversionBraced(TypeHandle, Vec<Expression>)

A type conversion with many arguments.

§

BracedInitList(Box<Expression>)

A braced init list expression.

§

New(Vec<Expression>, TypeHandle, Option<Initializer>)

The new operator.

§

GlobalNew(Vec<Expression>, TypeHandle, Option<Initializer>)

The global ::new operator.

§

NewArray(Vec<Expression>, TypeHandle, Option<Initializer>)

The new[] operator.

§

GlobalNewArray(Vec<Expression>, TypeHandle, Option<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(TypeHandle, Box<Expression>)

dynamic_cast<type> (expression)

§

StaticCast(TypeHandle, Box<Expression>)

static_cast<type> (expression)

§

ConstCast(TypeHandle, Box<Expression>)

const_cast<type> (expression)

§

ReinterpretCast(TypeHandle, Box<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)

§

Subobject(SubobjectExpr)

Subobject 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§

source§

impl Clone for Expression

source§

fn clone(&self) -> Expression

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Expression

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<Expression> for Expression

source§

fn eq(&self, other: &Expression) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Expression

source§

impl StructuralEq for Expression

source§

impl StructuralPartialEq for Expression

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.