Examples of ArrayCreationExpr


Examples of japa.parser.ast.expr.ArrayCreationExpr

        return Boolean.TRUE;
    }

    public Boolean visit(ArrayCreationExpr n1, Node arg) {
        ArrayCreationExpr n2 = (ArrayCreationExpr) arg;

        if (n1.getArrayCount() != n2.getArrayCount()) {
            return Boolean.FALSE;
        }

        if (!nodeEquals(n1.getType(), n2.getType())) {
            return Boolean.FALSE;
        }

        if (!nodeEquals(n1.getInitializer(), n2.getInitializer())) {
            return Boolean.FALSE;
        }

        if (!nodesEquals(n1.getDimensions(), n2.getDimensions())) {
            return Boolean.FALSE;
        }

        return Boolean.TRUE;
    }
View Full Code Here

Examples of japa.parser.ast.expr.ArrayCreationExpr

            case LONG:
            case SHORT:
                type = PrimitiveType();
                arr = ArrayDimsAndInits();
                if (arr[0] instanceof Integer) {
                    ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, ((Integer) arr[0]).intValue(), (ArrayInitializerExpr) arr[1]);
                } else {
                    ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, (List) arr[0], ((Integer) arr[1]).intValue());
                }
                break;
            default:
                jj_la1[98] = jj_gen;
                if (jj_2_31(2147483647)) {
                    type = ClassOrInterfaceType();
                    arr = ArrayDimsAndInits();
                    if (arr[0] instanceof Integer) {
                        ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, ((Integer) arr[0]).intValue(), (ArrayInitializerExpr) arr[1]);
                    } else {
                        ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, (List) arr[0], ((Integer) arr[1]).intValue());
                    }
                } else {
                    switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                        case IDENTIFIER:
                        case LT:
View Full Code Here

Examples of japa.parser.ast.expr.ArrayCreationExpr

  public Node visit(ArrayCreationExpr _n, Object _arg) {
    Type type_ = cloneNodes(_n.getType(), _arg);
    List<Expression> dimensions = visit(_n.getDimensions(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    ArrayCreationExpr r = new ArrayCreationExpr(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        type_, dimensions, _n.getArrayCount()
    );
    r.setComment(comment);
    if (_n.getInitializer() != null) // ArrayCreationExpr has two mutually exclusive constructors
      r.setInitializer(cloneNodes(_n.getInitializer(), _arg));
    return r;
  }
View Full Code Here

Examples of japa.parser.ast.expr.ArrayCreationExpr

    return Boolean.TRUE;
  }

  @Override public Boolean visit(final ArrayCreationExpr n1, final Node arg) {
    final ArrayCreationExpr n2 = (ArrayCreationExpr) arg;

    if (n1.getArrayCount() != n2.getArrayCount()) {
      return Boolean.FALSE;
    }

    if (!nodeEquals(n1.getType(), n2.getType())) {
      return Boolean.FALSE;
    }

    if (!nodeEquals(n1.getInitializer(), n2.getInitializer())) {
      return Boolean.FALSE;
    }

    if (!nodesEquals(n1.getDimensions(), n2.getDimensions())) {
      return Boolean.FALSE;
    }

    return Boolean.TRUE;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.