public override object Visit(ArrayCreateExpression arrayCreateExpression, object data)
 {
     if (arrayCreateExpression.ArrayInitializer == null) {
         return new CodeArrayCreateExpression(ConvType(arrayCreateExpression.CreateType.Type),
                                              0);
     }
     return new CodeArrayCreateExpression(ConvType(arrayCreateExpression.CreateType.Type),
                                          GetExpressionList(arrayCreateExpression.ArrayInitializer.CreateExpressions));
 }
Example #2
0
	void ObjectCreateExpression(
#line  1701 "VBNET.ATG" 
out Expression oce) {

#line  1703 "VBNET.ATG" 
		TypeReference type = null;
		Expression initializer = null;
		ArrayList arguments = null;
		oce = null;
		
		Expect(128);
		ArrayTypeName(
#line  1708 "VBNET.ATG" 
out type);
		if (la.kind == 25) {
			lexer.NextToken();
			if (StartOf(17)) {
				ArgumentList(
#line  1710 "VBNET.ATG" 
out arguments);
			}
			Expect(26);
		}
		if (la.kind == 21) {
			ArrayInitializer(
#line  1714 "VBNET.ATG" 
out initializer);
		}

#line  1717 "VBNET.ATG" 
		if(initializer == null) {
		oce = new ObjectCreateExpression(type, arguments);
		} else {
			ArrayCreateExpression ace = new ArrayCreateExpression(type, initializer as ArrayInitializerExpression);
			ace.Parameters = arguments;
			oce = ace;
		}
		
	}
 public virtual object Visit(ArrayCreateExpression arrayCreateExpression, object data)
 {
     if (arrayCreateExpression.ArrayInitializer == null) {
         return data;
     }
     return arrayCreateExpression.ArrayInitializer.AcceptVisitor(this, data);
 }
        public object Visit(ArrayCreateExpression ace, object data)
        {
            DebugOutput(ace);

            return String.Concat("new ",
                                 GetTypeString(ace.CreateType),
                                 "[",
                                 GetExpressionList(ace.Parameters),
                                 "]",
                                 ace.ArrayInitializer.AcceptVisitor(this, data));
        }
 public override object Visit(ArrayCreateExpression arrayCreateExpression, object data)
 {
     ReturnType type = new ReturnType(arrayCreateExpression.CreateType);
     if (arrayCreateExpression.Parameters != null && arrayCreateExpression.Parameters.Count > 0) {
         int[] newRank = new int[arrayCreateExpression.CreateType.RankSpecifier.Count + 1];
         newRank[0] = arrayCreateExpression.Parameters.Count - 1;
         for (int i = 0; i < type.ArrayDimensions.Length; ++i) {
             newRank[i + 1] = type.ArrayDimensions[i];
         }
         Array.Copy(type.ArrayDimensions, 0, newRank, 1, type.ArrayDimensions.Length);
         type.ArrayDimensions = newRank;
     }
     return type;
 }