ShuntingYard

com.phasmidsoftware.number.core.parse.ShuntingYardParser.ShuntingYard
See theShuntingYard companion object
case class ShuntingYard(values: Seq[CoreMillItem], operators: Seq[CoreMillItem])

A ShuntingYard consisting of two structures: a queue of values and a stack of operators.

NOTE: apparently, this is never used!

Value parameters

operators

a stack of operators which is temporarily placed here until switch is called.

values

a list of values and operators. The former are added directly to values. However, operators are only added indirectly, after a closing parenthesis (or the end of the string) is reached.

Attributes

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

Members list

Value members

Concrete methods

def :+(token: InfixToken): ShuntingYard

Method to add a token to this ShuntingYard.

Method to add a token to this ShuntingYard.

Value parameters

token

the token to add.

Attributes

Returns

a new ShuntingYard which is the same as this but with token added. If token is an operator, it is added to the operators; If token is a number, it is added to the values; If token is a open or close parenthesis, it is handled specially.

def toMill: Try[CoreMill]

Convert this ShuntingYard into a Mill. Any remaining operators must first be switched to the values stack.

Convert this ShuntingYard into a Mill. Any remaining operators must first be switched to the values stack.

Attributes

Returns

a Try[Mill].

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