Esempio n. 1
0
    /** Initializes the type descriptor */
    void initialize(TypeName t) {
      if (initialization != null) {
        TypeName et;
        if (dimension > 1)
          et = new ArrayTypeName(t, dimension - 1, false, SourceInfo.span(t, this));
        else et = t;

        initialization.setElementType(et);
      }
    }
 /* (non-Javadoc)
  * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ArrayInitializer)
  */
 public boolean visit(ArrayInitializer node) {
   PTArrayInitializer ai = InstantiationFactory.eINSTANCE.createPTArrayInitializer();
   List exps = node.expressions();
   List aiexps = ai.getExpressions();
   int nexp = exps.size();
   for (int i = 0; i < nexp; i++) {
     aiexps.add(perform((Expression) exps.get(i)));
   }
   expression = ai;
   return false;
 }
 /*
  * @see ASTVisitor#visit(ArrayInitializer)
  */
 @Override
 public boolean visit(ArrayInitializer node) {
   this.fBuffer.append("{"); // $NON-NLS-1$
   for (Iterator<Expression> it = node.expressions().iterator(); it.hasNext(); ) {
     Expression e = it.next();
     e.accept(this);
     if (it.hasNext()) {
       this.fBuffer.append(","); // $NON-NLS-1$
     }
   }
   this.fBuffer.append("}"); // $NON-NLS-1$
   return false;
 }