pub enum ExpressionKind {
    LoadConstant(Constant),
    ArithLog(ArithLogOpVec<Expression>),
    StreamAccess(StreamReferenceStreamAccessKindVec<Expression>),
    ParameterAccess(StreamReferenceusize),
    Ite {
        condition: Box<Expression>,
        consequence: Box<Expression>,
        alternative: Box<Expression>,
    },
    Tuple(Vec<Expression>),
    TupleAccess(Box<Expression>, usize),
    Function(FnExprKind),
    Widen(WidenExprKind),
    Default {
        expr: Box<Expression>,
        default: Box<Expression>,
    },
}
Expand description

The kinds of an Expression of the RtLolaHir.

Variants§

§

LoadConstant(Constant)

Loading a Constant

§

ArithLog(ArithLogOpVec<Expression>)

Applying arithmetic or logic operation

The first argument contains the operator of type ArithLogOp, the second arguments contains the arguments of the operation, which are Expressions. The vectors is structured as: Unary: 1st argument -> operand Binary: 1st argument -> lhs, 2nd argument -> rhs n-ary: kth argument -> kth operand

§

StreamAccess(StreamReferenceStreamAccessKindVec<Expression>)

Accessing another stream

A stream access has the following arguments:

  • the StreamReference of the stream that is accessed
  • the StreamAccessKind of the stream access, e.g. an offset access
  • the argmuents for parametrized stream accesses. This vector is empty if the stream that is accessed is not parametrized.
§

ParameterAccess(StreamReferenceusize)

Accessing the n’th parameter of a parameterized stream

This kind represents the access of a parameterized stream. For this, we use the folloing arguments:

  • the first argument contains the StreamReference of the parametrized stream that is accessed
  • the second argument contains the index of the parameter.
§

Ite

Fields

§condition: Box<Expression>

The condition of the if-then-else expression.

§consequence: Box<Expression>

The consequence of the if-then-else expression.

§alternative: Box<Expression>

The alternative of the if-then-else expression.

An if-then-else expression

If the condition evaluates to true, the consequence is executed otherwise the alternative. All arguments are an Expression.

§

Tuple(Vec<Expression>)

A tuple expression.

§

TupleAccess(Box<Expression>, usize)

Represents an access to a tuple element

The second argument indicates the index of the accessed element, while the first produces the accessed tuple.

§

Function(FnExprKind)

A function call with its monomorphic type

§

Widen(WidenExprKind)

A function call to widen the type of an Expression

§

Default

Fields

§expr: Box<Expression>

The expression that results in an optional value

§default: Box<Expression>

An infallible expression providing a default value of expr evaluates to None

Represents the transformation of an optional value into a “normal” 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

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.