/*
  * (non-Javadoc)
  *
  * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ConditionalExpression)
  */
 public boolean visit(ConditionalExpression node) {
   PTConditionalExpression ce = InstantiationFactory.eINSTANCE.createPTConditionalExpression();
   ce.setCondition(perform(node.getExpression()));
   ce.setTrue(perform(node.getThenExpression()));
   ce.setFalse(perform(node.getElseExpression()));
   expression = ce;
   return false;
 }
Ejemplo n.º 2
0
 @Override
 public Void visitConditionalExpression(ConditionalExpression node) {
   visit(node.getCondition());
   writer.print(" ? ");
   visit(node.getThenExpression());
   writer.print(" : ");
   visit(node.getElseExpression());
   return null;
 }
 /*
  * @see ASTVisitor#visit(ConditionalExpression)
  */
 @Override
 public boolean visit(ConditionalExpression node) {
   node.getExpression().accept(this);
   this.fBuffer.append("?"); // $NON-NLS-1$
   node.getThenExpression().accept(this);
   this.fBuffer.append(":"); // $NON-NLS-1$
   node.getElseExpression().accept(this);
   return false;
 }