Enum cpp_demangle::ast::Expression
source · [−]pub enum Expression {
Show 42 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>),
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(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)
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
sourceimpl Clone for Expression
impl Clone for Expression
sourcefn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Expression
impl Debug for Expression
sourceimpl PartialEq<Expression> for Expression
impl PartialEq<Expression> for Expression
sourcefn eq(&self, other: &Expression) -> bool
fn eq(&self, other: &Expression) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Expression) -> bool
fn ne(&self, other: &Expression) -> bool
This method tests for !=
.
impl Eq for Expression
impl StructuralEq for Expression
impl StructuralPartialEq for Expression
Auto Trait Implementations
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more