pub enum ExpressionKind {
    LoadConstant(Constant),
    ArithLog(ArithLogOpVec<Expression>),
    StreamAccess {
        target: StreamReference,
        parameters: Vec<Expression>,
        access_kind: StreamAccessKind,
    },
    ParameterAccess(StreamReferenceusize),
    Ite {
        condition: Box<Expression>,
        consequence: Box<Expression>,
        alternative: Box<Expression>,
    },
    Tuple(Vec<Expression>),
    TupleAccess(Box<Expression>, usize),
    Function(StringVec<Expression>),
    Convert {
        expr: Box<Expression>,
    },
    Default {
        expr: Box<Expression>,
        default: Box<Expression>,
    },
}
Expand description

This enum contains all possible kinds of expressions and their relevant information.

Variants§

§

LoadConstant(Constant)

Load a constant value

§

ArithLog(ArithLogOpVec<Expression>)

Apply an arithmetic or logic operation. The function is monomorphized.

Note: Arguments never need to be coerced. Unary: 1st argument -> operand Binary: 1st argument -> lhs, 2nd argument -> rhs n-ary: kth argument -> kth operand

§

StreamAccess

Fields

§target: StreamReference

The target stream to be accessed

§parameters: Vec<Expression>

The parameters of the specific stream instance that is accessed.

If the stream behind target is not parametrized, this collection is empty.

§access_kind: StreamAccessKind

The kind of access

Access another stream

§

ParameterAccess(StreamReferenceusize)

Access to the parameter of a stream represented by a stream reference, referencing the target stream and the index of the parameter that should be accessed.

§

Ite

Fields

§condition: Box<Expression>

The condition under which either consequence or alternative is selected.

§consequence: Box<Expression>

The consequence should be evaluated and returned if the condition evaluates to true.

§alternative: Box<Expression>

The alternative should be evaluated and returned if the condition evaluates to false.

A conditional (if-then-else) expression

§

Tuple(Vec<Expression>)

A tuple expression

§

TupleAccess(Box<Expression>, usize)

Represents a tuple projections, i.e., it accesses a specific tuple element.

§

Function(StringVec<Expression>)

Represents a function call. The function is monomorphized.

Note: Arguments never need to be coerced. Unary: 1st argument -> operand Binary: 1st argument -> lhs, 2nd argument -> rhs n-ary: kth argument -> kth operand

§

Convert

Fields

§expr: Box<Expression>

The expression that produces a value. The type of the expression indicates the source of the conversion.

Converting a value to a different type

The result type is indicated in the expression with the Convert kind.

§

Default

Fields

§expr: Box<Expression>

The expression that results in an optional value.

§default: Box<Expression>

An infallible expression providing the default value if expr fails to produce a value.

Transforms an optional value into a definitive one

Trait Implementations§

source§

impl Clone for ExpressionKind

source§

fn clone(&self) -> ExpressionKind

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 ExpressionKind

source§

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

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

impl<'de> Deserialize<'de> for ExpressionKind

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq<ExpressionKind> for ExpressionKind

source§

fn eq(&self, other: &ExpressionKind) -> 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 Serialize for ExpressionKind

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
    __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for ExpressionKind

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,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> Same<T> for T

§

type Output = T

Should always be Self
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.
const: unstable · 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.
const: unstable · source§

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

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere
    T: for<'de> Deserialize<'de>,