Expr

com.phasmidsoftware.number.expression.parse.ExpressionParser.Expr
case class Expr(t: ExpressionParser.this.Term, ts: List[String ExpressionParser.this.~ ExpressionParser.this.Term]) extends Tokens

Represents an expression consisting of a single term and a sequence of additional terms combined with operators, allowing for binary operations such as addition or subtraction.

Value parameters

t

the initial Term of the expression

ts

a list of pairs consisting of an operator and a subsequent Term

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def termVal(t: String ExpressionParser.this.~ ExpressionParser.this.Term): Try[Expression]
def value: Try[Expression]

Evaluates the value of the expression represented by the Expr instance. This method computes the result by sequentially applying the termVal function to each term in the sequence ts using the operator plus to combine intermediary results.

Evaluates the value of the expression represented by the Expr instance. This method computes the result by sequentially applying the termVal function to each term in the sequence ts using the operator plus to combine intermediary results.

Attributes

Returns

a Try[Expression] representing the result of the evaluation. If all terms are successfully evaluated, it returns a Success containing the final result. If an error occurs, it returns a Failure describing the issue.

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product