m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2019-11-11 16:16:08 +0100
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2019-11-11 16:16:08 +0100
commit53189bf52a25d0aeb87047abff5022f6241ef9cd (patch)
tree02b1be73520cce6294601d72d1800ebae1beec02
parent8feeb2fad561c3fc1ea1e9e4f0820498ed302794 (diff)
Interpret ExpMul
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/interpreter/Interpreter.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/interpreter/Interpreter.java b/src/main/java/pl/edu/mimuw/cloudatlas/interpreter/Interpreter.java
index 4634459..71a300b 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/interpreter/Interpreter.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/interpreter/Interpreter.java
@@ -368,8 +368,13 @@ public class Interpreter {
}
public Result visit(BasicExprMulC expr, Environment env) {
- // TODO
- throw new UnsupportedOperationException("Not yet implemented");
+ try {
+ Result left = expr.basicexpr_1.accept(new BasicExprInterpreter(), env);
+ Result right = expr.basicexpr_2.accept(new BasicExprInterpreter(), env);
+ return left.multiply(right);
+ } catch(Exception exception) {
+ throw new InsideQueryException(PrettyPrinter.print(expr), exception);
+ }
}
public Result visit(BasicExprDivC expr, Environment env) {