Enum rtlola_frontend::mir::ExpressionKind[][src]

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

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

Access another stream

Show fields

Fields of StreamAccess

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

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

A conditional (if-then-else) expression

Show fields

Fields of Ite

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.

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

Converting a value to a different type

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

Show fields

Fields of Convert

expr: Box<Expression>

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

Default

Transforms an optional value into a definitive one

Show fields

Fields of Default

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.

Trait Implementations

impl Clone for ExpressionKind[src]

fn clone(&self) -> ExpressionKind[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for ExpressionKind[src]

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

Formats the value using the given formatter. Read more

impl PartialEq<ExpressionKind> for ExpressionKind[src]

fn eq(&self, other: &ExpressionKind) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &ExpressionKind) -> bool[src]

This method tests for !=.

impl StructuralPartialEq for ExpressionKind[src]

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

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

Performs the conversion.