Package com.redhat.ceylon.compiler.java.codegen.Naming

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


            JCStatement block = make().Block(0, transformedBlock);
           
           
            JCForLoop loop = make().ForLoop(
                    List.<JCStatement>of(makeVar(indexName, make().Type(syms().intType), make().Literal(0))),
                    make().Binary(JCTree.LT, indexName.makeIdent(), lengthName.makeIdent()),
                    List.<JCExpressionStatement>nil(),
                    block);
            stmts.add(make().Labelled(this.label, loop));
           
            return stmts;
View Full Code Here


                result.add(makeVar(FINAL, stepName,
                        makeIndexType(),
                        stepExpr));
                result.add(
                make().If(
                        make().Binary(JCTree.LE, stepName.makeIdent(), make().Literal(0)),
                        makeThrowAssertionException(
                                new AssertionExceptionMessageBuilder(null)
                                    .appendViolatedCondition("step > 0")
                                    .prependAssertionDoc("step size must be greater than zero")
                                    .build()),
View Full Code Here

                String keyName = Naming.getVariableName(((Tree.KeyValueIterator)forIterator).getKeyVariable());
                JCStatement keyVariable = makeVar(FINAL,
                        keyName,
                        makeJavaType(keyType),
                        expressionGen().applyErasureAndBoxing(
                                make().Apply(null, naming.makeQualIdent(entryName.makeIdent(), "getKey"), List.<JCExpression>nil()),
                                typeFact().getAnythingDeclaration().getType(), true, BoxingStrategy.UNBOXED, keyType));
                ProducedType valueType = entryType.getTypeArgumentList().get(1);
                String valueName = Naming.getVariableName(((Tree.KeyValueIterator)forIterator).getValueVariable());
                JCStatement valueVariable = makeVar(FINAL,
                        valueName,
View Full Code Here

                String valueName = Naming.getVariableName(((Tree.KeyValueIterator)forIterator).getValueVariable());
                JCStatement valueVariable = makeVar(FINAL,
                        valueName,
                        makeJavaType(valueType),
                        expressionGen().applyErasureAndBoxing(
                                make().Apply(null, naming.makeQualIdent(entryName.makeIdent(), "getItem"), List.<JCExpression>nil()),
                                typeFact().getAnythingDeclaration().getType(), true, BoxingStrategy.UNBOXED, valueType));
                // Prepend to the block
                transformedBlock = transformedBlock.prepend(valueVariable);
                transformedBlock = transformedBlock.prepend(keyVariable);
                transformedBlock = transformedBlock.prepend(entryVariable);
View Full Code Here

                }
                SyntheticName qualName = getQualifierName(basename);
                appendStatement(gen.makeVar(Flags.FINAL, qualName,
                        instantiateQualfier.type,
                        instantiateQualfier.expression));
                newEncl = qualName.makeIdent();
            } else {
                newEncl = null;
            }
            arguments = List.<JCExpression>nil();
            int argumentNum = 0;
View Full Code Here

                if ((cbOpts & CB_ALIAS_ARGS) != 0) {
                    appendStatement(gen.makeVar(Flags.FINAL, name,
                            argumentAndType.type,
                            argumentAndType.expression));
                }
                arguments = arguments.append(name.makeIdent());
                argumentNum++;
            }
           
        } else {
            newEncl = this.instantiateQualfier != null ? this.instantiateQualfier.expression : null;
View Full Code Here

                //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
                        returnIfExhausted,
                            //record that we will have evaluated the expression
View Full Code Here

                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
                        returnIfExhausted,
                            //record that we will have evaluated the expression
                            setExhaustedTrue);
View Full Code Here

                ))));
                //equivalent to v=(ItemType)((Entry<KeyType,ItemType>)tmpItem).getItem()
                JCExpression castEntryExprItem = make().TypeCast(
                        makeJavaType(typeFact().getIteratedType(iterType)),
                        tmpItem.makeIdent());
                elseBody.add(make().Exec(make().Assign(itemName.makeIdent(),
                    make().TypeCast(makeJavaType(item.getType(), JT_NO_PRIMITIVES),
                        make().Apply(null, makeSelect(castEntryExprItem, "getItem"),
                            List.<JCExpression>nil())
                ))));
            }
View Full Code Here

                int a) {
            SyntheticName name = parameterName(a);
            Parameter param = paramLists.getParameters().get(a);
            makeDowncastOrDefaultVar(stmts,
                    name, param, a, arity);
            args.append(name.makeIdent());
        }
       
        /**
         * Makes a call to {@code $call$typed()} if required, otherwise uses the
         * given body.
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.