From 53189bf52a25d0aeb87047abff5022f6241ef9cd Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Mon, 11 Nov 2019 16:16:08 +0100 Subject: Interpret ExpMul --- .../java/pl/edu/mimuw/cloudatlas/interpreter/Interpreter.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/main/java/pl/edu/mimuw/cloudatlas') 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) { -- cgit v1.2.3