diff --git a/src/main/java/de/dhbw/horb/ExpressionGenerator.java b/src/main/java/de/dhbw/horb/ExpressionGenerator.java index 205eb65..30b33e7 100644 --- a/src/main/java/de/dhbw/horb/ExpressionGenerator.java +++ b/src/main/java/de/dhbw/horb/ExpressionGenerator.java @@ -2,6 +2,9 @@ package de.dhbw.horb; import de.dhbw.horb.ast.*; +import java.util.List; +import java.util.stream.Collectors; + public class ExpressionGenerator extends DecafBaseVisitor { @Override public Expression visitBinaryOperation(DecafParser.BinaryOperationContext ctx) { @@ -10,7 +13,10 @@ public class ExpressionGenerator extends DecafBaseVisitor { @Override public Expression visitFunCallExpression(DecafParser.FunCallExpressionContext ctx) { - throw new RuntimeException("TODO"); + String name = ctx.funcCall().id().getText(); + List expressions = ctx.funcCall().args().expr(); + List args = expressions.stream().map(this::visit).toList(); + return new FunctionCall(name, args); } @Override