You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
509 B
29 lines
509 B
package net.mightypork.rcalc.tokens;
|
|
|
|
|
|
import net.mightypork.rcalc.TokenList;
|
|
import net.mightypork.rcalc.operations.Operation;
|
|
import net.mightypork.rcalc.operations.OperationPower;
|
|
|
|
|
|
/**
|
|
* Exponentiation token
|
|
*
|
|
* @author Ondrej Hruska
|
|
*/
|
|
public class TokenOperatorPower extends TokenBinaryOperator {
|
|
|
|
@Override
|
|
public String toString() {
|
|
|
|
return "^";
|
|
}
|
|
|
|
|
|
@Override
|
|
public Operation toOperation(TokenList left, TokenList right) {
|
|
|
|
return new OperationPower(left.parse(), right.parse());
|
|
}
|
|
|
|
}
|
|
|