01: /*
02: * Copyright (C) 2007 Júlio Vilmar Gesser.
03: *
04: * This file is part of Java 1.5 parser and Abstract Syntax Tree.
05: *
06: * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License as published by
08: * the Free Software Foundation, either version 3 of the License, or
09: * (at your option) any later version.
10: *
11: * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public License
17: * along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
18: */
19: /*
20: * Created on 05/10/2006
21: */
22: package japa.parser.ast.expr;
23:
24: import japa.parser.ast.type.Type;
25: import japa.parser.ast.visitor.GenericVisitor;
26: import japa.parser.ast.visitor.VoidVisitor;
27:
28: import java.util.List;
29:
30: /**
31: * @author Julio Vilmar Gesser
32: */
33: public final class ArrayCreationExpr extends Expression {
34:
35: public final Type type;
36:
37: public final List<Type> typeArgs;
38:
39: public final int arrayCount;
40:
41: public final ArrayInitializerExpr initializer;
42:
43: public final List<Expression> dimensions;
44:
45: public ArrayCreationExpr(int line, int column, Type type,
46: List<Type> typeArgs, int arrayCount,
47: ArrayInitializerExpr initializer) {
48: super (line, column);
49: this .type = type;
50: this .typeArgs = typeArgs;
51: this .arrayCount = arrayCount;
52: this .initializer = initializer;
53: this .dimensions = null;
54: }
55:
56: public ArrayCreationExpr(int line, int column, Type type,
57: List<Type> typeArgs, List<Expression> dimensions,
58: int arrayCount) {
59: super (line, column);
60: this .type = type;
61: this .typeArgs = typeArgs;
62: this .arrayCount = arrayCount;
63: this .dimensions = dimensions;
64: this .initializer = null;
65: }
66:
67: @Override
68: public <A> void accept(VoidVisitor<A> v, A arg) {
69: v.visit(this , arg);
70: }
71:
72: @Override
73: public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
74: return v.visit(this, arg);
75: }
76:
77: }
|