[][src]Enum moore_svlog::hir::ExprKind

pub enum ExprKind {
    IntConst {
        width: usize,
        value: BigInt,
        signed: bool,
        special_bits: BitVec,
        x_bits: BitVec,
    },
    UnsizedConst(char),
    TimeConst(BigRational),
    StringConst(Spanned<Name>),
    Ident(Spanned<Name>),
    Unary(UnaryOpNodeId),
    Binary(BinaryOpNodeIdNodeId),
    Field(NodeIdSpanned<Name>),
    Index(NodeIdIndexMode),
    Builtin(BuiltinCall),
    Ternary(NodeIdNodeIdNodeId),
    Scope(NodeIdSpanned<Name>),
    PositionalPattern(Vec<NodeId>),
    NamedPattern(Vec<(PatternMapping, NodeId)>),
    RepeatPattern(NodeIdVec<NodeId>),
    EmptyPattern,
    Concat(Option<NodeId>, Vec<NodeId>),
    Cast(NodeIdNodeId),
    Inside(NodeIdVec<Spanned<InsideRange>>),
}

The different forms an expression can take.

Variants

IntConst

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.

Fields of IntConst

width: usizevalue: BigIntsigned: boolspecial_bits: BitVecx_bits: BitVec
UnsizedConst(char)

An unsized and unbased constant literal such as '0.

TimeConst(BigRational)

A time constant literal.

StringConst(Spanned<Name>)

A string constant literal.

Ident(Spanned<Name>)

An identifier.

Unary(UnaryOpNodeId)

A unary operator.

Binary(BinaryOpNodeIdNodeId)

A binary operator.

Field(NodeIdSpanned<Name>)

A field access such as a.b.

Index(NodeIdIndexMode)

An index access such as a[b] or a[b:c].

Builtin(BuiltinCall)

A builtin function call such as $clog2(x).

Ternary(NodeIdNodeIdNodeId)

A ternary expression such as a ? b : c.

Scope(NodeIdSpanned<Name>)

A scope expression such as foo::bar.

PositionalPattern(Vec<NodeId>)

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}.

RepeatPattern(NodeIdVec<NodeId>)

A repeat pattern such as '{32{a, b, c}}.

EmptyPattern

The empty pattern '{}.

Concat(Option<NodeId>, Vec<NodeId>)

A concatenation such as {a,b} or {4{a,b}}.

Cast(NodeIdNodeId)

A cast (ty, expr) such as foo'(bar).

An inside expression such as a inside {b, c}.

Trait Implementations

impl Clone for ExprKind[src]

impl Debug for ExprKind[src]

impl Eq for ExprKind[src]

impl PartialEq<ExprKind> for ExprKind[src]

impl StructuralEq for ExprKind[src]

impl StructuralPartialEq for ExprKind[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.