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