diff --git a/Visitors/SemanticAnalyzer.java b/Visitors/SemanticAnalyzer.java index 0992802f8a1c8a4e8b20ad664c0e6e76b6a86567..b3e92b8972ad3bbbeaad7c713e146f1247a061f8 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 !"); }