Enum conch_parser::ast::Arithmetic [] [src]

pub enum Arithmetic<T> {
    Var(T),
    Literal(isize),
    Pow(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    PostIncr(T),
    PostDecr(T),
    PreIncr(T),
    PreDecr(T),
    UnaryPlus(Box<Arithmetic<T>>),
    UnaryMinus(Box<Arithmetic<T>>),
    LogicalNot(Box<Arithmetic<T>>),
    BitwiseNot(Box<Arithmetic<T>>),
    Mult(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    Div(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    Modulo(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    Add(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    Sub(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    ShiftLeft(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    ShiftRight(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    Less(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    LessEq(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    Great(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    GreatEq(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    Eq(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    NotEq(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    BitwiseAnd(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    BitwiseXor(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    BitwiseOr(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    LogicalAnd(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    LogicalOr(Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    Ternary(Box<Arithmetic<T>>, Box<Arithmetic<T>>, Box<Arithmetic<T>>),
    Assign(T, Box<Arithmetic<T>>),
    Sequence(Vec<Arithmetic<T>>),
}

Represents an expression within an arithmetic subsitution.

Generic over the representation of a variable name.

Variants

The value of a variable, e.g. $var or var.

A numeric literal such as 42 or 0xdeadbeef.

left ** right.

Returns the current value of a variable, and then increments its value immediately after, e.g. var++

Returns the current value of a variable, and then decrements its value immediately after, e.g. var--

Increments the value of a variable and returns the new value, e.g. ++var.

Decrements the value of a variable and returns the new value, e.g. --var.

Ensures the sign of the underlying result is positive, e.g. +(1-2).

Ensures the sign of the underlying result is negative, e.g. -(1+2).

Returns one if the underlying result is zero, or zero otherwise, e.g. !expr.

Flips all bits from the underlying result, e.g. ~expr.

left * right

left / right

left % right

left + right

left - right

left << right

left >> right

left < right

left <= right

left > right

left >= right

left == right

left != right

left & right

left ^ right

left | right

left && right

left || right

first ? second : third

Assigns the value of an underlying expression to a variable and returns the value, e.g. x = 5, or x += 2.

expr[, expr[, ...]]

Trait Implementations

impl<T: Debug> Debug for Arithmetic<T>
[src]

Formats the value using the given formatter.

impl<T: PartialEq> PartialEq for Arithmetic<T>
[src]

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

This method tests for !=.

impl<T: Eq> Eq for Arithmetic<T>
[src]

impl<T: Clone> Clone for Arithmetic<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more