Enum moore_svlog::hir::ExprKind [−][src]
pub enum ExprKind<'a> {
Show 22 variants
IntConst {
width: usize,
value: BigInt,
signed: bool,
special_bits: BitVec,
x_bits: BitVec,
},
UnsizedConst(char),
TimeConst(BigRational),
StringConst(Spanned<Name>),
Ident(Spanned<Name>),
Unary(UnaryOp, NodeId),
Binary(BinaryOp, NodeId, NodeId),
Field(NodeId, Spanned<Name>),
Index(NodeId, IndexMode),
Builtin(BuiltinCall<'a>),
Ternary(NodeId, NodeId, NodeId),
Scope(NodeId, Spanned<Name>),
PositionalPattern(Vec<NodeId>),
NamedPattern(Vec<(PatternMapping, NodeId)>),
RepeatPattern(NodeId, Vec<NodeId>),
Concat(Option<NodeId>, Vec<NodeId>),
Cast(NodeId, NodeId),
CastSign(Spanned<Sign>, NodeId),
CastSize(NodeId, NodeId),
Inside(NodeId, Vec<Spanned<InsideRange>>),
FunctionCall(NodeId, Vec<CallArg>),
Assign {
op: AssignOp,
lhs: &'a Expr<'a>,
rhs: &'a Expr<'a>,
},
}
Expand description
The different forms an expression can take.
Variants
An integer constant literal such as 42
or 'd42
or 32'd42
.
The special_bits
mask keeps track of which bits in the number are x
or z
. The x_bits
mask tracks which of these special bits are x
.
UnsizedConst(char)
An unsized and unbased constant literal such as '0
.
Tuple Fields of UnsizedConst
0: char
TimeConst(BigRational)
A time constant literal.
Tuple Fields of TimeConst
0: BigRational
A string constant literal.
An identifier.
A unary operator.
A binary operator.
A field access such as a.b
.
An index access such as a[b]
or a[b:c]
.
Builtin(BuiltinCall<'a>)
A builtin function call such as $clog2(x)
.
Tuple Fields of Builtin
0: BuiltinCall<'a>
A ternary expression such as a ? b : c
.
A scope expression such as foo::bar
.
A positional pattern such as '{a, b, c}
.
NamedPattern(Vec<(PatternMapping, NodeId)>)
A named pattern such as '{logic: a, foo: b, 31: c, default: d}
.
Tuple Fields of NamedPattern
0: Vec<(PatternMapping, NodeId)>
A repeat pattern such as '{32{a, b, c}}
.
A concatenation such as {a,b}
or {4{a,b}}
.
A cast (ty, expr)
such as foo'(bar)
.
A sign cast such as unsigned'(foo)
.
A size cast (size_expr, expr)
such as 42'(foo)
.
Inside(NodeId, Vec<Spanned<InsideRange>>)
An inside expression such as a inside {b, c}
.
Tuple Fields of Inside
0: NodeId
1: Vec<Spanned<InsideRange>>
A function call such as foo(a, b, c)
.
An assignment.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for ExprKind<'a>
impl<'a> !UnwindSafe for ExprKind<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more