TP-metaprogrammation-test/TP1/ExpressionTernaire.java

38 lines
773 B
Java
Raw Normal View History

2021-12-03 14:52:36 +00:00
public class ExpressionTernaire implements Expression {
private AccesVariable operande1;
private Expression operande2;
private Expression operande3;
private OperateurTernaire operateur;
public ExpressionTernaire(OperateurTernaire op, AccesVariable e1, Expression e2, Expression e3)
{
this.operateur = op;
this.operande1 = e1;
this.operande2 = e2;
this.operande3 = e3;
}
public AccesVariable getOperande1() {
return this.operande1;
}
public Expression getOperande2() {
return this.operande2;
}
public Expression getOperande3() {
return this.operande3;
}
public OperateurTernaire getOperateur() {
return this.operateur;
}
public <R> R accepter(VisiteurExpression<R> visiteur) {
return visiteur.visiterExpressionTernaire(this);
}
}