Skip to main content

ChapelExpr

Enum ChapelExpr 

Source
pub enum ChapelExpr {
Show 25 variants IntLit(i64), RealLit(f64), BoolLit(bool), StrLit(String), Var(String), Apply(Box<ChapelExpr>, Vec<ChapelExpr>), Index(Box<ChapelExpr>, Box<ChapelExpr>), FieldAccess(Box<ChapelExpr>, String), BinOp(String, Box<ChapelExpr>, Box<ChapelExpr>), UnOp(String, Box<ChapelExpr>), RangeLit(Box<ChapelExpr>, Box<ChapelExpr>, bool), ReduceExpr(String, Box<ChapelExpr>), ForallExpr(String, Box<ChapelExpr>, Box<ChapelExpr>), CoforallExpr(String, Box<ChapelExpr>, Box<ChapelExpr>), TupleLit(Vec<ChapelExpr>), ArrayLit(Vec<ChapelExpr>), Cast(Box<ChapelExpr>, ChapelType), IfExpr(Box<ChapelExpr>, Box<ChapelExpr>, Box<ChapelExpr>), New(ChapelType, Vec<ChapelExpr>), Nil, Here, NumLocales, This, TypeOf(Box<ChapelExpr>), DomainLit(Vec<ChapelExpr>),
}
Expand description

Chapel expression representation.

Variants§

§

IntLit(i64)

Integer literal: 42

§

RealLit(f64)

Real literal: 3.14

§

BoolLit(bool)

Bool literal: true / false

§

StrLit(String)

String literal: "hello"

§

Var(String)

Variable reference: x

§

Apply(Box<ChapelExpr>, Vec<ChapelExpr>)

Function/procedure application: f(a, b, ...)

§

Index(Box<ChapelExpr>, Box<ChapelExpr>)

Array index: a[i]

§

FieldAccess(Box<ChapelExpr>, String)

Field/member access: r.field

§

BinOp(String, Box<ChapelExpr>, Box<ChapelExpr>)

Binary operation: lhs op rhs

§

UnOp(String, Box<ChapelExpr>)

Unary operation: op e

§

RangeLit(Box<ChapelExpr>, Box<ChapelExpr>, bool)

Range: lo..hi or lo..#n

§

ReduceExpr(String, Box<ChapelExpr>)

Reduce expression: + reduce arr

§

ForallExpr(String, Box<ChapelExpr>, Box<ChapelExpr>)

Forall expression: [i in D] f(i)

§

CoforallExpr(String, Box<ChapelExpr>, Box<ChapelExpr>)

Coforall expression body reference

§

TupleLit(Vec<ChapelExpr>)

Tuple literal: (e1, e2, ...)

§

ArrayLit(Vec<ChapelExpr>)

Array literal: [e1, e2, ...]

§

Cast(Box<ChapelExpr>, ChapelType)

Cast: e : t

§

IfExpr(Box<ChapelExpr>, Box<ChapelExpr>, Box<ChapelExpr>)

Conditional (ternary): if cond then t else e

§

New(ChapelType, Vec<ChapelExpr>)

New object: new C(args...)

§

Nil

nil

§

Here

here locale

§

NumLocales

numLocales

§

This

this reference

§

TypeOf(Box<ChapelExpr>)

Type query: e.type

§

DomainLit(Vec<ChapelExpr>)

Domain literal: {e1, e2, ...} or {lo..hi}

Trait Implementations§

Source§

impl Clone for ChapelExpr

Source§

fn clone(&self) -> ChapelExpr

Returns a duplicate 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 ChapelExpr

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.