--- /dev/null
+package net.sourceforge.phpdt.internal.compiler.ast;
+
+/**
+ * A ConditionalExpression is like that : booleanExpression ? trueValue : falseValue;
+ * @author Matthieu Casanova
+ */
+public class ConditionalExpression extends OperatorExpression {
+
+ public Expression condition, valueIfTrue, valueIfFalse;
+
+ public ConditionalExpression(Expression condition,
+ Expression valueIfTrue,
+ Expression valueIfFalse) {
+ super(-1, condition.sourceStart, valueIfFalse.sourceEnd);
+ this.condition = condition;
+ this.valueIfTrue = valueIfTrue;
+ this.valueIfFalse = valueIfFalse;
+ }
+
+ public String toStringExpressionNoParenthesis() {
+ final StringBuffer buff = new StringBuffer("(");
+ buff.append(condition.toStringExpression());
+ buff.append(") ? ");
+ buff.append(valueIfTrue.toStringExpression());
+ buff.append(" : ");
+ buff.append(valueIfFalse.toStringExpression());
+ return buff.toString();
+ }
+}