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

pub enum ExpressionKind {
    LoadConstant(Constant),
    ArithLog(ArithLogOp, Vec<Expression>),
    StreamAccess {
        target: StreamReference,
        parameters: Vec<Expression>,
        access_kind: StreamAccessKind,
    },
    ParameterAccess(StreamReference, usize),
    Ite {
        condition: Box<Expression>,
        consequence: Box<Expression>,
        alternative: Box<Expression>,
    },
    Tuple(Vec<Expression>),
    TupleAccess(Box<Expression>, usize),
    Function(String, Vec<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

Load a constant value

Tuple Fields of LoadConstant

0: Constant
ArithLog

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

Tuple Fields of ArithLog

0: ArithLogOp1: Vec<Expression>
StreamAccess

Access another stream

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

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.

Tuple Fields of ParameterAccess

0: StreamReference1: usize
Ite

A conditional (if-then-else) expression

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

A tuple expression

Tuple Fields of Tuple

0: Vec<Expression>
TupleAccess

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

Tuple Fields of TupleAccess

0: Box<Expression>1: usize
Function

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

Tuple Fields of Function

0: String1: Vec<Expression>
Convert

Converting a value to a different type

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

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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

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

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.