From 6ddf39b54df3c7620ae00ef7630f0cf7a935ac34 Mon Sep 17 00:00:00 2001 From: "lucien.noel" <lucien.noel@etu.hesge.ch> Date: Thu, 26 Jan 2023 16:40:44 +0100 Subject: [PATCH] =?UTF-8?q?correction=20de=20la=20condition=20dans=20l'ana?= =?UTF-8?q?lyse=20s=C3=A9mantique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Visitors/SemanticAnalyzer.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Visitors/SemanticAnalyzer.java b/Visitors/SemanticAnalyzer.java index 0992802..b3e92b8 100755 --- a/Visitors/SemanticAnalyzer.java +++ b/Visitors/SemanticAnalyzer.java @@ -64,16 +64,7 @@ public class SemanticAnalyzer implements ASTVisitor { public Object visit(Condition node) { node.getCondition().accept(this); - Expression cond = (node.getCondition() instanceof Parentheses) - ? ((Parentheses) node.getCondition()).getExpression() - : node.getCondition(); - if (!(cond instanceof Vrai || cond instanceof Faux || - (cond instanceof Idf - && TDS.getInstance().identifier(new Entree(((Idf) cond).getNom())).getType() instanceof Booleen) - || - cond instanceof Egal || cond instanceof Diff || - cond instanceof Inferieur || cond instanceof InfEgal || - cond instanceof Superieur || cond instanceof SupEgal)) { + if (!isExpressionBooleen(node.getCondition())) { throw new RuntimeException("la condition passée n'est pas un booleen !"); } -- GitLab