@Override public Choice<State<JCNewArray>> visitNewArray(final NewArrayTree node, State<?> state) { return chooseSubtrees( state, s -> unifyExpressions(node.getDimensions(), s), s -> unifyExpressions(node.getInitializers(), s), (dims, inits) -> maker().NewArray((JCExpression) node.getType(), dims, inits)); }
@Override public JCNewArray inline(Inliner inliner) throws CouldNotResolveImportException { return inliner .maker() .NewArray( (getType() == null) ? null : getType().inline(inliner), (getDimensions() == null) ? null : inliner.<JCExpression>inlineList(getDimensions()), (getInitializers() == null) ? null : inliner.<JCExpression>inlineList(getInitializers())); }
@Override public boolean visitAnnotationValueArray(AnnotationValueArray node) { return posSet(node, treeMaker.NewArray( null, List.<JCExpression>nil(), toList(JCExpression.class, node.astValues()) )); }
@Override public boolean visitAnnotationValueArray(AnnotationValueArray node) { return posSet(node, treeMaker.NewArray( null, List.<JCExpression>nil(), toList(JCExpression.class, node.astValues()) )); }
@Override public boolean visitArrayInitializer(ArrayInitializer node) { return posSet(node, treeMaker.NewArray( null, List.<JCExpression>nil(), toList(JCExpression.class, node.astExpressions()) )); }
@Override public boolean visitAnnotationValueArray(AnnotationValueArray node) { return posSet(node, treeMaker.NewArray( null, List.<JCExpression>nil(), toList(JCExpression.class, node.astValues()) )); }
@Override public boolean visitArrayInitializer(ArrayInitializer node) { return posSet(node, treeMaker.NewArray( null, List.<JCExpression>nil(), toList(JCExpression.class, node.astExpressions()) )); }
@Override public boolean visitArrayInitializer(ArrayInitializer node) { return posSet(node, treeMaker.NewArray( null, List.<JCExpression>nil(), toList(JCExpression.class, node.astExpressions()) )); }
public JCTree visitNewArray(NewArrayTree node, P p) { JCNewArray t = (JCNewArray) node; JCExpression elemtype = copy(t.elemtype, p); List<JCExpression> dims = copy(t.dims, p); List<JCExpression> elems = copy(t.elems, p); return M.at(t.pos).NewArray(elemtype, dims, elems); }
public JCTree visitNewArray(NewArrayTree node, P p) { JCNewArray t = (JCNewArray) node; JCExpression elemtype = copy(t.elemtype, p); List<JCExpression> dims = copy(t.dims, p); List<JCExpression> elems = copy(t.elems, p); return M.at(t.pos).NewArray(elemtype, dims, elems); }
public JCTree visitNewArray(NewArrayTree node, P p) { JCNewArray t = (JCNewArray) node; JCExpression elemtype = copy(t.elemtype, p); List<JCExpression> dims = copy(t.dims, p); List<JCExpression> elems = copy(t.elems, p); return M.at(t.pos).NewArray(elemtype, dims, elems); }
public JCTree visitNewArray(NewArrayTree node, P p) { JCNewArray t = (JCNewArray) node; JCExpression elemtype = copy(t.elemtype, p); List<JCExpression> dims = copy(t.dims, p); List<JCExpression> elems = copy(t.elems, p); return M.at(t.pos).NewArray(elemtype, dims, elems); }
public void visitArray(Attribute.Array array) { ListBuffer<JCExpression> elems = new ListBuffer<JCExpression>(); for (int i = 0; i < array.values.length; i++) elems.append(translate(array.values[i])); result = NewArray(null, List.<JCExpression>nil(), elems.toList()).setType(array.type); } JCExpression translate(Attribute a) {
public void visitArray(Attribute.Array array) { ListBuffer<JCExpression> elems = new ListBuffer<JCExpression>(); for (int i = 0; i < array.values.length; i++) elems.append(translate(array.values[i])); result = NewArray(null, List.<JCExpression>nil(), elems.toList()).setType(array.type); } JCExpression translate(Attribute a) {
public void visitArray(Attribute.Array array) { ListBuffer<JCExpression> elems = new ListBuffer<JCExpression>(); for (int i = 0; i < array.values.length; i++) elems.append(translate(array.values[i])); result = NewArray(null, List.<JCExpression>nil(), elems.toList()).setType(array.type); } JCExpression translate(Attribute a) {
public void visitArray(Attribute.Array array) { ListBuffer<JCExpression> elems = new ListBuffer<JCExpression>(); for (int i = 0; i < array.values.length; i++) elems.append(translate(array.values[i])); result = NewArray(null, List.<JCExpression>nil(), elems.toList()).setType(array.type); } JCExpression translate(Attribute a) {
@Override public Choice<State<JCNewArray>> visitNewArray(final NewArrayTree node, State<?> state) { return chooseSubtrees( state, s -> unifyExpressions(node.getDimensions(), s), s -> unifyExpressions(node.getInitializers(), s), (dims, inits) -> maker().NewArray((JCExpression) node.getType(), dims, inits)); }
public NewArrayTree NewArray(Tree elemtype, List<? extends ExpressionTree> dimensions, List<? extends ExpressionTree> initializers) { ListBuffer<JCExpression> dims = new ListBuffer<JCExpression>(); for (ExpressionTree t : dimensions) dims.append((JCExpression)t); ListBuffer<JCExpression> elems = null; if (initializers != null) { elems = new ListBuffer<JCExpression>(); for (ExpressionTree t : initializers) elems.append((JCExpression)t); } return make.at(NOPOS).NewArray((JCExpression)elemtype, dims.toList(), elems != null ? elems.toList() : null); }
@Override public JCNewArray inline(Inliner inliner) throws CouldNotResolveImportException { return inliner .maker() .NewArray( (getType() == null) ? null : getType().inline(inliner), (getDimensions() == null) ? null : inliner.<JCExpression>inlineList(getDimensions()), (getInitializers() == null) ? null : inliner.<JCExpression>inlineList(getInitializers())); }
/** ArrayInitializer = "{" [VariableInitializer {"," VariableInitializer}] [","] "}" */ JCExpression arrayInitializer(int newpos, JCExpression t) { accept(LBRACE); ListBuffer<JCExpression> elems = new ListBuffer<JCExpression>(); if (S.token() == COMMA) { S.nextToken(); } else if (S.token() != RBRACE) { elems.append(variableInitializer()); while (S.token() == COMMA) { S.nextToken(); if (S.token() == RBRACE) break; elems.append(variableInitializer()); } } accept(RBRACE); return toP(F.at(newpos).NewArray(t, List.<JCExpression>nil(), elems.toList())); }