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

correction de la condition dans l'analyse sémantique

parent bbf8c79a
No related branches found
No related tags found
No related merge requests found
......@@ -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 !");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment