Examples of asName()


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

            ListBuffer<JCStatement> result = ListBuffer.<JCStatement>lb();
           
            // Note: Must invoke lhs, rhs and increment in the correct order!
            // long start = <lhs>
            SyntheticName start = naming.temp("start");
            result.append(make().VarDef(make().Modifiers(FINAL), start.asName(), makeType(),
                    expressionGen().transformExpression(lhs, BoxingStrategy.UNBOXED, getType())));
            // long end = <rhs>
            SyntheticName end = naming.temp("end");
            result.append(make().VarDef(make().Modifiers(FINAL), end.asName(), makeType(),
                    expressionGen().transformExpression(rhs, BoxingStrategy.UNBOXED, getType())));
View Full Code Here

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

            SyntheticName start = naming.temp("start");
            result.append(make().VarDef(make().Modifiers(FINAL), start.asName(), makeType(),
                    expressionGen().transformExpression(lhs, BoxingStrategy.UNBOXED, getType())));
            // long end = <rhs>
            SyntheticName end = naming.temp("end");
            result.append(make().VarDef(make().Modifiers(FINAL), end.asName(), makeType(),
                    expressionGen().transformExpression(rhs, BoxingStrategy.UNBOXED, getType())));
           
            final SyntheticName by;
            if (increment != null) {
                by = naming.temp("by");
View Full Code Here

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

           
            final SyntheticName by;
            if (increment != null) {
                by = naming.temp("by");
                // 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(
View Full Code Here

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

                by = null;
            }
           
            SyntheticName increasing = naming.temp("increasing");
            // boolean increasing = start < end;
            result.append(make().VarDef(make().Modifiers(FINAL), increasing.asName(), make().Type(syms().booleanType),
                    make().Binary(JCTree.LE, start.makeIdent(), end.makeIdent())));
           
            SyntheticName incr = naming.temp("incr");
           
            result.append(make().VarDef(make().Modifiers(FINAL), incr.asName(), makeType(),
View Full Code Here

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

            result.append(make().VarDef(make().Modifiers(FINAL), increasing.asName(), make().Type(syms().booleanType),
                    make().Binary(JCTree.LE, start.makeIdent(), end.makeIdent())));
           
            SyntheticName incr = naming.temp("incr");
           
            result.append(make().VarDef(make().Modifiers(FINAL), incr.asName(), makeType(),
                    make().Conditional(
                            increasing.makeIdent(),
                            makeIncreasingIncrement(by), makeDecreasingIncrement(by))));
           
            SyntheticName varname = naming.alias(getVariable().getIdentifier().getText());
View Full Code Here

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

                    make().Conditional(
                            increasing.makeIdent(),
                            makeIncreasingIncrement(by), makeDecreasingIncrement(by))));
           
            SyntheticName varname = naming.alias(getVariable().getIdentifier().getText());
            JCVariableDecl init = make().VarDef(make().Modifiers(0), varname.asName(), makeType(), start.makeIdent());
            Tree.ControlClause prevForclause = currentForClause;
            currentForClause = stmt.getForClause();
            List<JCStatement> blockStatements = transformBlock(getBlock());
            currentForClause = prevForclause;
            blockStatements = blockStatements.prepend(make().VarDef(make().Modifiers(FINAL),
View Full Code Here

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

                    make().Apply(null, makeSelect(iterableName.makeIdent(), "iterator"), List.<JCExpression> nil()));
        } else {
            getIter = at(node).Apply(null, makeSelect(iterableExpr, "iterator"), List.<JCExpression> nil());
        }
        getIter = gen().expressionGen().applyErasureAndBoxing(getIter, iteratorType, true, BoxingStrategy.BOXED, iteratorType);
        JCVariableDecl iteratorDecl = at(node).VarDef(make().Modifiers(0), iterName.asName(), iteratorTypeExpr, getIter);
        // .ceylon.language.Iterator<T> LOOP_VAR_NAME$iter$X = ITERABLE.getIterator();
        result.append(iteratorDecl);
       
        ListBuffer<JCStatement> loopBody = ListBuffer.<JCStatement>lb();
       
View Full Code Here

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

        ProducedType supertype = intersectionOfCatchClauseTypes(catchClauses);
        JCExpression exceptionType = makeJavaType(supertype, JT_CATCH | JT_RAW);
        SyntheticName exceptionVar = naming.alias("exception");
        JCVariableDecl param = make().VarDef(
                make().Modifiers(Flags.FINAL),
                exceptionVar.asName(),
                exceptionType, null);
       
        ArrayList<Tree.CatchClause> reversed = new ArrayList<Tree.CatchClause>(catchClauses);
        Collections.reverse(reversed);
       
View Full Code Here

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

                assert (ctxtName == null);
                ctxtName = naming.synthetic(Prefix.$next$, idx);
                //define a variable that records if the expression was already evaluated
                SyntheticName exhaustedName = ctxtName.suffixedBy(Suffix.$exhausted$);
                    JCVariableDecl exhaustedDef = make().VarDef(make().Modifiers(Flags.PRIVATE),
                            exhaustedName.asName(), makeJavaType(typeFact().getBooleanDeclaration().getType()), null);
                    fields.add(exhaustedDef);
                    JCStatement returnIfExhausted = make().If(exhaustedName.makeIdent(), make().Return(makeBoolean(false)), null);
                    JCStatement setExhaustedTrue = make().Exec(make().Assign(exhaustedName.makeIdent(), makeBoolean(true)));
                    initBlock =  List.<JCStatement>of(
                        //if we already evaluated the expression, return
View Full Code Here

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

     * Turn this long value into an int value by applying (int)(e ^ (e >>> 32))
     */
    public JCExpression convertToIntForHashAttribute(JCExpression value) {
        SyntheticName tempName = naming.temp("hash");
        JCExpression type = make().Type(syms().longType);
        JCBinary combine = make().Binary(JCTree.BITXOR, makeUnquotedIdent(tempName.asName()),
                make().Binary(JCTree.USR, makeUnquotedIdent(tempName.asName()), makeInteger(32)));
        return make().TypeCast(syms().intType, makeLetExpr(tempName, null, type, value, combine));
    }

    /**
 
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.