Packages

abstract class Operator[R] extends Postfix[R] with Precedence[R]

Represents an operator.

An operator is something that takes in the values on either side of it as arguments. For example, in the expression 3 + 4, + is an operator that takes in the arguments 3 and 4.

Operators also have precedence. Operators with higher precedence are evaluated first. For example, the expression 3 + 4 * 2, is interpreted as 3 + (4 * 2) because the * operator has higher precedence than the + operator.

R

The type that the evaluator should return after evaluating the tokens

Source
Token.scala
Linear Supertypes
Precedence[R], Postfix[R], Token[R], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Operator
  2. Precedence
  3. Postfix
  4. Token
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Operator(precedence: Int, associativity: Associativity)

    precedence

    The precedence of this operator. This cannot be Int.MinValue or Int.MaxValue, as these are reserved for brackets and functions respectively.

    associativity

    The associativity of the token - either Associativity.Left or Associativity.Right. See Associativity for more information.

Abstract Value Members

  1. abstract def apply(left: R, right: R): R

    Returns the result of applying this operator on two values.

    Returns the result of applying this operator on two values.

    left

    The value to the left of the operator

    right

    The value to the right of the operator

    returns

    The result of applying the operator

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. val associativity: Associativity
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  16. val precedence: Int
    Definition Classes
    Operator → Precedence
  17. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Precedence[R]

Inherited from Postfix[R]

Inherited from Token[R]

Inherited from AnyRef

Inherited from Any

Ungrouped