object Token
- Alphabetic
- By Inheritance
- Token
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
ArgSeparator
[R]() extends Token[R] with Product with Serializable
An argument separator.
An argument separator.
This distinguishes between multiple arguments in a Function.
- R
The type that the evaluator should return after evaluating the tokens
-
case class
CloseParen
[R]() extends Parenthesis[R] with Product with Serializable
A close parenthesis.
A close parenthesis.
- R
The type that the evaluator should return after evaluating the tokens
-
abstract
class
Function
[R] extends Postfix[R] with Precedence[R]
Represents a function.
Represents a function.
A function can have zero or more arguments. Immediately following the function, there should be a pair of brackets, within which there should be the arguments to the function. The arguments to the function should be separated by the ArgSeparator token.
For example, in
sin(4)
,sin
is a function that accepts one argument. Similarly, inmax(3, 4)
,max
is a function that accepts two arguments, and ',
' is an argument separator.- R
The type that the evaluator should return after evaluating the tokens
-
case class
OpenParen
[R]() extends Parenthesis[R] with Product with Serializable
An open parenthesis.
An open parenthesis.
- R
The type that the evaluator should return after evaluating the tokens
-
abstract
class
Operator
[R] extends Postfix[R] with Precedence[R]
Represents an operator.
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 arguments3
and4
.Operators also have
precedence
. Operators with higher precedence are evaluated first. For example, the expression3 + 4 * 2
, is interpreted as3 + (4 * 2)
because the*
operator has higher precedence than the+
operator.- R
The type that the evaluator should return after evaluating the tokens
-
sealed abstract
class
Parenthesis
[R] extends Precedence[R]
Either an open or close parenthesis.
Either an open or close parenthesis.
Parentheses are used to separate sections of an expression and indicate it acts as one value. For example, in
4 * (2 + 3)
, the parentheses indicate that the2 + 3
should be evaluated first.Parentheses are also used after functions.
- R
The type that the evaluator should return after evaluating the tokens
-
abstract
class
Value
[R] extends Postfix[R]
Represents a value.
Represents a value.
A value is anything that stands on its own, and can be evaluated without any arguments.
For example, in the expression
2 + x
, both2
andx
are values - the former a constant and the latter a variable.The value of the function doesn't need to be fixed. For example, there may be a value
rand
which returns a random number between 0 and 1 every time it's evaluated.- R
The type that the evaluator should return after evaluating the tokens
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
This is the documentation for the Evaluator project (see GitHub).
The main package net.totietje.evaluator. The net.totietje.complex package contains an example usage of this package, which may also be useful.