Package com.sun.tools.javac.tree.JCTree

Examples of com.sun.tools.javac.tree.JCTree.JCVariableDecl


    private void appendVarsForReifiedTypeArguments() {
        java.util.List<JCExpression> reifiedTypeArgs = gen.makeReifiedTypeArguments(producedReference);
        int index = 0;
        for(JCExpression reifiedTypeArg : reifiedTypeArgs){
            Naming.SyntheticName argName = reifiedTypeArgName(index);
            JCVariableDecl varDecl = gen.makeVar(argName, gen.makeTypeDescriptorType(), reifiedTypeArg);
            this.vars.append(varDecl);
            index++;
        }
    }
View Full Code Here


        if(isParameterWithDependentCovariantTypeParameters(declaredParam)) {
            exprFlags |= ExpressionTransformer.EXPR_EXPECTED_TYPE_HAS_DEPENDENT_COVARIANT_TYPE_PARAMETERS;
        }
        JCExpression typeExpr = gen.makeJavaType(type, jtFlags);
        JCExpression argExpr = gen.expressionGen().transformExpression(expr, boxType, type, exprFlags);
        JCVariableDecl varDecl = gen.makeVar(argName, typeExpr, argExpr);
        statements = ListBuffer.<JCStatement>of(varDecl);
        bind(declaredParam, argName, gen.makeJavaType(type, jtFlags), statements.toList());
    }
View Full Code Here

                callableType,
                Collections.singletonList(methodArg.getParameterLists().get(0)),
                gen.classGen().transformMplBody(methodArg.getParameterLists(), model, body));
        JCNewClass callable = callableBuilder.build();
        JCExpression typeExpr = gen.makeJavaType(callableType, JT_RAW);
        JCVariableDecl varDecl = gen.makeVar(argName, typeExpr, callable);
       
        statements = ListBuffer.<JCStatement>of(varDecl);
        bind(declaredParam, argName, gen.makeJavaType(callableType), statements.toList());
    }
View Full Code Here

    private void bindObjectArgument(Tree.ObjectArgument objectArg,
            Parameter declaredParam, Naming.SyntheticName argName) {
        ListBuffer<JCStatement> statements;
        List<JCTree> object = gen.classGen().transformObjectArgument(objectArg);
        // No need to worry about boxing (it cannot be a boxed type)
        JCVariableDecl varDecl = gen.makeLocalIdentityInstance(argName.getName(), Naming.quoteClassName(objectArg.getIdentifier().getText()), false);
        statements = toStmts(objectArg, object).append(varDecl);
        bind(declaredParam, argName, gen.makeJavaType(objectArg.getType().getTypeModel()), statements.toList());
    }
View Full Code Here

            flags |= JT_TYPE_ARGUMENT;
        }
        ProducedType type = gen.getTypeForParameter(param, producedReference, gen.TP_TO_BOUND);
        Naming.SyntheticName argName = argName(param);
        JCExpression typeExpr = gen.makeJavaType(type, flags);
        JCVariableDecl varDecl = gen.makeVar(argName, typeExpr, argExpr);
        bind(param, argName, gen.makeJavaType(type, flags), List.<JCStatement>of(varDecl));
    }
View Full Code Here

            } else {
                thisType = gen.makeJavaType(target.getQualifyingType(), JT_NO_PRIMITIVES);
            }
            defaultedParameterInstance = callVarName.makeIdent();
        }
        JCVariableDecl thisDecl = gen.makeVar(varBaseName.suffixedBy(Suffix.$argthis$),
                thisType,
                defaultedParameterInstance);
        return thisDecl;
    }
View Full Code Here

                    owner.make().Literal(false)));
            JCBlock handlerBlock = owner.make().Block(0, List.<JCTree.JCStatement>of(saveException, nullValue, initFlagFalse));
           
            // the catch block
            JCExpression throwableType = owner.makeJavaType(owner.syms().throwableType.tsym);
            JCVariableDecl exceptionParam = owner.make().VarDef(owner.make().Modifiers(0),
                    owner.naming.makeUnquotedName(exceptionName),
                    throwableType , null);
            JCCatch catchers = owner.make().Catch(exceptionParam, handlerBlock);
           
            // $initException$ = null
View Full Code Here

        int i;
        for (i = 0; (i + 1) < args.length; i += 2) {
            JCExpression typeExpr = args[i];
            JCExpression valueExpr = args[i+1];
            varName = varBaseName + ((args.length > 3) ? "$" + i : "");
            JCVariableDecl varDecl = makeVar(varName, typeExpr, valueExpr);
            decls.append(varDecl);
        }
       
        JCExpression result;
        if (i == args.length) {
View Full Code Here

    }

    private LetExpr makeIgnoredEvalAndReturn(JCExpression toEval, JCExpression toReturn){
        // define a variable of type j.l.Object to hold the result of the evaluation
        JCVariableDecl def = makeVar(naming.temp(), make().Type(syms().objectType), toEval);
        // then ignore this result and return something else
        return make().LetExpr(def, toReturn);

    }
View Full Code Here

        String descriptorName = naming.getTypeArgumentDescriptorName(param);
        long flags = PRIVATE;
        if(!isCompanion)
            flags |= FINAL;
        List<JCAnnotation> annotations = makeAtIgnore();
        JCVariableDecl localVar = make().VarDef(make().Modifiers(flags, annotations), names().fromString(descriptorName),
                makeTypeDescriptorType(), null);
        return localVar;
    }
View Full Code Here

TOP

Related Classes of com.sun.tools.javac.tree.JCTree.JCVariableDecl

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.