Skip to content
Snippets Groups Projects
Commit e36bac9f authored by lucien.noel's avatar lucien.noel
Browse files

analyse de la boucle pour terminée

parent f7e477b5
Branches
No related tags found
No related merge requests found
......@@ -232,7 +232,7 @@ public class SemanticAnalyzer implements ASTVisitor {
node.getDroite().accept(this);
if(!(isExpressionBooleen(node.getGauche()) && isExpressionBooleen(node.getDroite()))){
throw new RuntimeException("impossible d'effectuer l'opération 'ou' sur des valeurs non-booléennes !");
throw new RuntimeException("Impossible d'effectuer l'opération 'ou' sur des valeurs non-booléennes !");
}
return null;
......@@ -248,7 +248,9 @@ public class SemanticAnalyzer implements ASTVisitor {
node.getFrom().accept(this);
node.getTo().accept(this);
node.getInstruction().accept(this);
if(!(isExpressionNumber(node.getFrom()) && isExpressionNumber(node.getTo()) && isExpressionNumber(node.getIteratorName()))){
throw new RuntimeException("Erreur dans la condition de la boucle 'pour' !");
}
return null;
}
......@@ -319,6 +321,9 @@ public class SemanticAnalyzer implements ASTVisitor {
}
public Object visit(Tantque node) {
if(!isExpressionBooleen(node.getCondition())){
throw new RuntimeException("Condition de l'opération 'tantque' n'est pas un booléen !");
}
return null;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment