Package japa.parser.ast.body

Examples of japa.parser.ast.body.VariableDeclaratorId


            }

            // Create a Java Parser constructor parameter and add it to the list
            // of parameters
            final Parameter p = new Parameter(parameterType,
                    new VariableDeclaratorId(parameterName));
            p.setAnnotations(parameterAnnotations);
            parameters.add(p);
        }

        // Set the body
View Full Code Here


            }

            // Create a Java Parser method parameter and add it to the list of
            // parameters
            final Parameter p = new Parameter(parameterType,
                    new VariableDeclaratorId(parameterName));
            p.setVarArgs(methodParameter.isVarArgs());
            p.setAnnotations(parameterAnnotations);
            parameters.add(p);
        }
View Full Code Here

     * @param name
     *            name of the parameter
     * @return instance of {@link Parameter}
     */
    public static Parameter createParameter(Type type, String name) {
        return new Parameter(type, new VariableDeclaratorId(name));
    }
View Full Code Here

     * @param name
     *            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

        return Boolean.TRUE;
    }

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

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

        if (!objEquals(n1.getName(), n2.getName())) {
            return Boolean.FALSE;
        }

        return Boolean.TRUE;
    }
View Full Code Here

        }
        throw new Error("Missing return statement in function");
    }

    final public VariableDeclarator VariableDeclarator() throws ParseException {
        VariableDeclaratorId id;
        Expression init = null;
        id = VariableDeclaratorId();
        switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case ASSIGN:
                jj_consume_token(ASSIGN);
                init = VariableInitializer();
                break;
            default:
                jj_la1[31] = jj_gen;
                ;
        }
        {
            if (true) {
                return new VariableDeclarator(id.getBeginLine(), id.getBeginColumn(), token.endLine, token.endColumn, id, init);
            }
        }
        throw new Error("Missing return statement in function");
    }
View Full Code Here

            jj_consume_token(RBRACKET);
            arrayCount++;
        }
        {
            if (true) {
                return new VariableDeclaratorId(line, column, token.endLine, token.endColumn, name, arrayCount);
            }
        }
        throw new Error("Missing return statement in function");
    }
View Full Code Here

    final public Parameter FormalParameter() throws ParseException {
        Modifier modifier;
        Type type;
        boolean isVarArg = false;
        VariableDeclaratorId id;
        modifier = Modifiers();
        type = Type();
        switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case ELLIPSIS:
                jj_consume_token(ELLIPSIS);
View Full Code Here

     * @param name
     *            name of the parameter
     * @return instance of {@link Parameter}
     */
    public static Parameter createParameter(Type type, String name) {
        return new Parameter(type, new VariableDeclaratorId(name));
    }
View Full Code Here

TOP

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

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.