Package japa.parser.ast.body

Examples of japa.parser.ast.body.VariableDeclarator


    final public VariableDeclarationExpr VariableDeclarationExpression() throws ParseException {
        Modifier modifier;
        Type type;
        List vars = new LinkedList();
        VariableDeclarator var;
        modifier = Modifiers();
        type = Type();
        var = VariableDeclarator();
        vars.add(var);
        label_41: while (true) {
View Full Code Here


     *            field name
     * @return instance of {@link FieldDeclaration}
     */
    public static FieldDeclaration createFieldDeclaration(int modifiers, Type type, String name) {
        VariableDeclaratorId id = new VariableDeclaratorId(name);
        VariableDeclarator variable = new VariableDeclarator(id);
        return createFieldDeclaration(modifiers, type, variable);
    }
View Full Code Here

     *            name
     * @return instance of {@link VariableDeclarationExpr}
     */
    public static VariableDeclarationExpr createVariableDeclarationExpr(Type type, String name) {
        List<VariableDeclarator> vars = new ArrayList<VariableDeclarator>();
        vars.add(new VariableDeclarator(new VariableDeclaratorId(name)));
        return new VariableDeclarationExpr(type, vars);
    }
View Full Code Here

  public Node visit(VariableDeclarator _n, Object _arg) {
    VariableDeclaratorId id = cloneNodes(_n.getId(), _arg);
    Expression init = cloneNodes(_n.getInit(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    VariableDeclarator r = new VariableDeclarator(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        id, init
    );
    r.setComment(comment);
    return r;
  }
View Full Code Here

    printModifiers(n.getModifiers());
    n.getType().accept(this, arg);

    printer.print(" ");
    for (final Iterator<VariableDeclarator> i = n.getVariables().iterator(); i.hasNext();) {
      final VariableDeclarator var = i.next();
      var.accept(this, arg);
      if (i.hasNext()) {
        printer.print(", ");
      }
    }
View Full Code Here

    n.getType().accept(this, arg);
    printer.print(" ");

    for (final Iterator<VariableDeclarator> i = n.getVars().iterator(); i.hasNext();) {
      final VariableDeclarator v = i.next();
      v.accept(this, arg);
      if (i.hasNext()) {
        printer.print(", ");
      }
    }
  }
View Full Code Here

    return Boolean.TRUE;
  }

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

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

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

    return Boolean.TRUE;
  }
View Full Code Here

TOP

Related Classes of japa.parser.ast.body.VariableDeclarator

Copyright © 2018 www.massapicom. 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.