diff --git a/Triangle.Compiler/src/main/java/triangle/abstractSyntaxTrees/visitors/CommandVisitor.java b/Triangle.Compiler/src/main/java/triangle/abstractSyntaxTrees/visitors/CommandVisitor.java index 6a74a76..c0f440a 100644 --- a/Triangle.Compiler/src/main/java/triangle/abstractSyntaxTrees/visitors/CommandVisitor.java +++ b/Triangle.Compiler/src/main/java/triangle/abstractSyntaxTrees/visitors/CommandVisitor.java @@ -25,6 +25,6 @@ public interface CommandVisitor { TResult visitWhileCommand(WhileCommand ast, TArg arg); - TResult visitLoopWhile(LoopWhile loopWhile, TArg arg); + TResult visitLoopWhile(LoopWhile ast, TArg arg); } diff --git a/Triangle.Compiler/src/main/java/triangle/contextualAnalyzer/Checker.java b/Triangle.Compiler/src/main/java/triangle/contextualAnalyzer/Checker.java index 0fbbde0..f4b32ee 100644 --- a/Triangle.Compiler/src/main/java/triangle/contextualAnalyzer/Checker.java +++ b/Triangle.Compiler/src/main/java/triangle/contextualAnalyzer/Checker.java @@ -189,6 +189,19 @@ public final class Checker implements ActualParameterVisitor, var d2 = ast.C.visit(this); return layoutBinary("WhileCom.", d1, d2); } + + @Override + public DrawingTree visitLoopWhile(LoopWhile ast, Void arg) { + var d1 = ast.C1.visit(this); + var d2 = ast.E.visit(this); + var d3 = ast.C2.visit(this); + return layoutTernary("LoopWhile.", d1, d2, d3); + } + + // Expressions @Override @@ -681,11 +691,4 @@ public class LayoutVisitor implements ActualParameterVisitor, return r; } - - @Override - public DrawingTree visitLoopWhile(LoopWhile loopWhile, Void arg) { - // TODO Auto-generated method stub - return null; - } - } \ No newline at end of file diff --git a/build/libs/Triangle-Tools.jar b/build/libs/Triangle-Tools.jar index 8644910..ee0b873 100644 Binary files a/build/libs/Triangle-Tools.jar and b/build/libs/Triangle-Tools.jar differ diff --git a/loopwhile.tam b/loopwhile.tam index 7091eac..b8dd1cb 100644 Binary files a/loopwhile.tam and b/loopwhile.tam differ diff --git a/programs/loopwhile.tri b/programs/loopwhile.tri index 3f6f2fc..156fd05 100644 --- a/programs/loopwhile.tri +++ b/programs/loopwhile.tri @@ -1,10 +1,14 @@ ! print out ababababa let - var a : Integer + var a : Integer; + var b : Integer in begin a := 0; + b := 10; + putint(b); + loop begin put('a');