Examples of makeIdent()


Examples of com.redhat.ceylon.compiler.java.codegen.Naming.SyntheticName.makeIdent()

                // by = increment;
                result.append(make().VarDef(make().Modifiers(FINAL), by.asName(), makeType(),
                        expressionGen().transformExpression(increment, BoxingStrategy.UNBOXED, getType())));
                // if (by <= 0) throw Exception("step size must be greater than zero");
                result.append(make().If(
                        make().Binary(JCTree.LE, by.makeIdent(), make().Literal(0)),
                        makeThrowAssertionException(
                                new AssertionExceptionMessageBuilder(null)
                                    .appendViolatedCondition("step > 0")
                                    .prependAssertionDoc("step size must be greater than zero")
                                    .build()),
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.codegen.Naming.SyntheticName.makeIdent()

            List<JCStatement> blockStatements = transformBlock(getBlock());
            currentForClause = prevForclause;
            blockStatements = blockStatements.prepend(make().VarDef(make().Modifiers(FINAL),
                    names().fromString(Naming.getVariableName(getVariable())),
                    makeType(),
                    varname.makeIdent()));
           
            // for (long i = start; (increasing ? i -end <= 0 : i -end >= 0); i+=inc) {
            JCConditional cond = make().Conditional(increasing.makeIdent(),
                    make().Binary(JCTree.LE, make().Binary(JCTree.MINUS, varname.makeIdent(), end.makeIdent()), makeZero()),
                    make().Binary(JCTree.GE, make().Binary(JCTree.MINUS, varname.makeIdent(), end.makeIdent()), makeZero()));
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.codegen.Naming.SyntheticName.makeIdent()

                    makeType(),
                    varname.makeIdent()));
           
            // for (long i = start; (increasing ? i -end <= 0 : i -end >= 0); i+=inc) {
            JCConditional cond = make().Conditional(increasing.makeIdent(),
                    make().Binary(JCTree.LE, make().Binary(JCTree.MINUS, varname.makeIdent(), end.makeIdent()), makeZero()),
                    make().Binary(JCTree.GE, make().Binary(JCTree.MINUS, varname.makeIdent(), end.makeIdent()), makeZero()));
            List<JCExpressionStatement> step = List.<JCExpressionStatement>of(make().Exec(make().Assignop(JCTree.PLUS_ASG, varname.makeIdent(), incr.makeIdent())));
            result.append(make().Labelled(this.label, make().ForLoop(
                    List.<JCStatement>of(init),
                    cond,
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.codegen.Naming.SyntheticName.makeIdent()

                    varname.makeIdent()));
           
            // for (long i = start; (increasing ? i -end <= 0 : i -end >= 0); i+=inc) {
            JCConditional cond = make().Conditional(increasing.makeIdent(),
                    make().Binary(JCTree.LE, make().Binary(JCTree.MINUS, varname.makeIdent(), end.makeIdent()), makeZero()),
                    make().Binary(JCTree.GE, make().Binary(JCTree.MINUS, varname.makeIdent(), end.makeIdent()), makeZero()));
            List<JCExpressionStatement> step = List.<JCExpressionStatement>of(make().Exec(make().Assignop(JCTree.PLUS_ASG, varname.makeIdent(), incr.makeIdent())));
            result.append(make().Labelled(this.label, make().ForLoop(
                    List.<JCStatement>of(init),
                    cond,
                    step,
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.codegen.Naming.SyntheticName.makeIdent()

           
            // for (long i = start; (increasing ? i -end <= 0 : i -end >= 0); i+=inc) {
            JCConditional cond = make().Conditional(increasing.makeIdent(),
                    make().Binary(JCTree.LE, make().Binary(JCTree.MINUS, varname.makeIdent(), end.makeIdent()), makeZero()),
                    make().Binary(JCTree.GE, make().Binary(JCTree.MINUS, varname.makeIdent(), end.makeIdent()), makeZero()));
            List<JCExpressionStatement> step = List.<JCExpressionStatement>of(make().Exec(make().Assignop(JCTree.PLUS_ASG, varname.makeIdent(), incr.makeIdent())));
            result.append(make().Labelled(this.label, make().ForLoop(
                    List.<JCStatement>of(init),
                    cond,
                    step,
                    make().Block(0, blockStatements))));
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.codegen.Naming.SyntheticName.makeIdent()

        // The user-supplied contents of the loop
        loopBody.appendList(bodyStmts);
       
        // ELEM_NAME = LOOP_VAR_NAME$iter$X.next()
        JCExpression iter_elem = make().Apply(null, makeSelect(iterName.makeIdent(), "next"), List.<JCExpression> nil());
        JCExpression elem_assign = make().Assign(iterationVarName.makeIdent(), iter_elem);
        // !((ELEM_NAME = LOOP_VAR_NAME$iter$X.next()) instanceof Finished)
        JCExpression instof = make().TypeTest(elem_assign, makeIdent(syms().ceylonFinishedType));
        JCExpression loopCond = make().Unary(JCTree.NOT, instof);
        if (optForArray || optForTuple) {
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.codegen.Naming.SyntheticName.makeIdent()

                exceptionType, null);
       
        ArrayList<Tree.CatchClause> reversed = new ArrayList<Tree.CatchClause>(catchClauses);
        Collections.reverse(reversed);
       
        JCStatement elsePart = make().Throw(exceptionVar.makeIdent());
       
        for (Tree.CatchClause catchClause : reversed) {
            Tree.Variable caughtVar = catchClause.getCatchVariable().getVariable();
            ProducedType caughtType = caughtVar.getType().getTypeModel();
            List<JCStatement> catchBlock = transformBlock(catchClause.getBlock());
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.codegen.Naming.SyntheticName.makeIdent()

            List<JCStatement> catchBlock = transformBlock(catchClause.getBlock());
            catchBlock = catchBlock.prepend(
                    makeVar(FINAL,
                        caughtVar.getIdentifier().getText(),
                        makeJavaType(caughtType),
                        expressionGen().applyErasureAndBoxing(exceptionVar.makeIdent(),
                                supertype, true, true, BoxingStrategy.BOXED, caughtType, 0)));
            elsePart = make().If(makeOptimizedTypeTest(null, exceptionVar, caughtType, caughtType),
                    make().Block(0, catchBlock),
                    elsePart);
        }
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.codegen.Naming.SyntheticName.makeIdent()

           
            SyntheticName indexName = naming.alias("index");
           
            List<JCStatement> transformedBlock = transformBlock(getBlock());
            transformedBlock = transformedBlock.prepend(make().Exec(
                    make().Assignop(JCTree.PLUS_ASG, indexName.makeIdent(),
                        make().Apply(null,
                                naming.makeQualIdent(make().Type(syms().characterObjectType), "charCount"),
                                List.<JCExpression>of(naming.makeQuotedIdent(Naming.getVariableName(getElementOrKeyVariable())))))));
            transformedBlock = transformedBlock.prepend(makeVar(FINAL,
                    Naming.getVariableName(getElementOrKeyVariable()),
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.codegen.Naming.SyntheticName.makeIdent()

            transformedBlock = transformedBlock.prepend(makeVar(FINAL,
                    Naming.getVariableName(getElementOrKeyVariable()),
                    make().Type(syms().intType),
                    make().Apply(null,
                            naming.makeQualIdent(stringName.makeIdent(), "codePointAt"),
                            List.<JCExpression>of(indexName.makeIdent()))));
           
            JCStatement block = make().Block(0, transformedBlock);
           
           
            JCForLoop loop = make().ForLoop(
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.