Expression

com.phasmidsoftware.number.expression.parse.ArithmeticParser.Expression
trait Expression

Represents an abstract mathematical or logical expression.

The Expression trait provides a contract for evaluating and displaying expressions. It is designed to handle expressions that return a result of type T wrapped in a Try, allowing for both successful evaluations and error reporting.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def show(indent: Int): String

Displays a textual representation of the expression with the specified indentation.

Displays a textual representation of the expression with the specified indentation.

Value parameters

indent

the number of spaces to prepend to each line of the output, used to control indentation.

Attributes

Returns

a string representing the formatted expression.

def value: Try[ArithmeticParser.this.T]

Evaluates the expression and returns the result wrapped in a Try. The Try indicates whether the evaluation was successful (Success) or resulted in an error (Failure).

Evaluates the expression and returns the result wrapped in a Try. The Try indicates whether the evaluation was successful (Success) or resulted in an error (Failure).

Attributes

Returns

a Try[T] containing either the result of the evaluation or an error.