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
504 B
29 lines
504 B
package net.mightypork.rcalc.tokens;
|
|
|
|
|
|
import net.mightypork.rcalc.TokenList;
|
|
import net.mightypork.rcalc.operations.Operation;
|
|
import net.mightypork.rcalc.operations.OperationModulo;
|
|
|
|
|
|
/**
|
|
* Modulo token
|
|
*
|
|
* @author Ondrej Hruska
|
|
*/
|
|
public class TokenOperatorModulo extends TokenBinaryOperator {
|
|
|
|
@Override
|
|
public String toString() {
|
|
|
|
return "%";
|
|
}
|
|
|
|
|
|
@Override
|
|
public Operation toOperation(TokenList left, TokenList right) {
|
|
|
|
return new OperationModulo(left.parse(), right.parse());
|
|
}
|
|
|
|
}
|
|
|