pub enum Expression {
Show 18 variants
Identifier(Box<Node<Identifier>>),
Constant(Box<Node<Constant>>),
StringLiteral(Box<Node<StringLiteral>>),
GenericSelection(Box<Node<GenericSelection>>),
Member(Box<Node<MemberExpression>>),
Call(Box<Node<CallExpression>>),
CompoundLiteral(Box<Node<CompoundLiteral>>),
SizeOfTy(Box<Node<SizeOfTy>>),
SizeOfVal(Box<Node<SizeOfVal>>),
AlignOf(Box<Node<AlignOf>>),
UnaryOperator(Box<Node<UnaryOperatorExpression>>),
Cast(Box<Node<CastExpression>>),
BinaryOperator(Box<Node<BinaryOperatorExpression>>),
Conditional(Box<Node<ConditionalExpression>>),
Comma(Box<Vec<Node<Expression>>>),
OffsetOf(Box<Node<OffsetOfExpression>>),
VaArg(Box<Node<VaArgExpression>>),
Statement(Box<Node<Statement>>),
}
Expand description
Expressions
(C11 6.5)
Variants§
Identifier(Box<Node<Identifier>>)
Identifier
May be a variable, function name or enumerator. The latter is different from the standard, where enumerators are classified as constants.
(C11 6.5.1)
Constant(Box<Node<Constant>>)
Numeric and character constants
Enumerator constants, being valid identifiers, are reprented
as Identifier
in this enum.
(C11 6.5.1)
StringLiteral(Box<Node<StringLiteral>>)
String literal
(C11 6.5.1)
GenericSelection(Box<Node<GenericSelection>>)
Generic selection
(C11 6.5.1.1)
Member(Box<Node<MemberExpression>>)
Structure and union members
Both direct (.
) and indirect (->
) access.
(C11 6.5.2)
Call(Box<Node<CallExpression>>)
Function call expression
(C11 6.5.2)
CompoundLiteral(Box<Node<CompoundLiteral>>)
Compound literal
(C11 6.5.2)
SizeOfTy(Box<Node<SizeOfTy>>)
Size of a type
(C11 6.5.3)
SizeOfVal(Box<Node<SizeOfVal>>)
Size of a unary expression
(C11 6.5.3)
AlignOf(Box<Node<AlignOf>>)
Alignment of a type
(C11 6.5.3)
UnaryOperator(Box<Node<UnaryOperatorExpression>>)
Unary operators
This represents both postfix and prefix unary oprators. Postfix expressions that take additional operands are represented by a separate entry in this enum.
(C11 6.5.2, c11 6.5.3)
Cast(Box<Node<CastExpression>>)
Cast expression
(type) expr
(C11 6.5.4)
BinaryOperator(Box<Node<BinaryOperatorExpression>>)
Binary operators
All of C binary operators that can be applied to two expressions.
(C11 6.5.5 – 6.5.16)
Conditional(Box<Node<ConditionalExpression>>)
Conditional operator
(C11 6.5.15)
Comma(Box<Vec<Node<Expression>>>)
Comma operator
(C11 6.5.17)
OffsetOf(Box<Node<OffsetOfExpression>>)
Member offset expression
Result of expansion of offsetof
macro.
(C11 7.19 §3).
VaArg(Box<Node<VaArgExpression>>)
Variable argument list access
Result of expansion of va_arg
macro.
(C11 7.16.1.1).
Statement(Box<Node<Statement>>)
Statement expression
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more