Package org.openquark.cal.internal.javamodel.JavaStatement

Examples of org.openquark.cal.internal.javamodel.JavaStatement.Block


         * @return the constructor for the data type class.
         */
        private JavaConstructor createConstructor_allArgs (Set<FieldName> fieldNames, Map<FieldName, JavaTypeName> fieldNameToType, Map<FieldName, Boolean> fieldNameToStrictness) {
            String[] argNames = new String [fieldNames.size()];
            JavaTypeName[] argTypes = new JavaTypeName [fieldNames.size()];
            Block constructorBody = new Block();

            int i = 0;
            for (final FieldName fn : fieldNames) {
                boolean strict = fieldNameToStrictness.get(fn).booleanValue();
                JavaTypeName type = JavaTypeNames.RTVALUE;
                if (strict) {
                    type = fieldNameToType.get(fn);
                }
                String fieldName = SCJavaDefn.getJavaFieldNameFromFieldName(fn);
                String argName = fieldName+"$";

                argNames[i] = argName;
                argTypes[i] = type;
                MethodVariable mv = new MethodVariable (argName);
                JavaExpression.JavaField.Instance field =
                    new JavaExpression.JavaField.Instance(null, fieldName, type);
                JavaExpression assign = new Assignment (field, mv);
                constructorBody.addStatement(new ExpressionStatement(assign));
                i++;
            }

            JavaConstructor constructor = new JavaConstructor (Modifier.PROTECTED, argNames, argTypes, className.getUnqualifiedJavaSourceName());
            constructor.addStatement(constructorBody);
View Full Code Here


                    SwitchStatement.SwitchCase sc = new SwitchStatement.IntCaseGroup(dc.getOrdinal(), new ReturnStatement(field));
                    ordSwitch.addCase(sc);
                } else {
                    // This is a valid ordinal for the data type but does not correspond to a zero arity DC.
                    LiteralWrapper badValueMessageWrapper = LiteralWrapper.make ("Attempt to treat " + dc.getName() + " as a zero arity data constructor.");
                    Block block = new Block();
                    block.addStatement(new JavaStatement.LineComment(dc.getName().getQualifiedName()));
                    JavaExpression castExpression = new CastExpression(tagDCTypeName, new MethodInvocation.Static(JavaTypeNames.RTVALUE, "badValue", badValueMessageWrapper, JavaTypeName.STRING, JavaTypeNames.RTVALUE));
                    block.addStatement(new ReturnStatement(castExpression));
                    ordSwitch.addCase(new SwitchStatement.IntCaseGroup (dc.getOrdinal(), block));
                }
            }

            // Add a default case in the switch to throw an error if an invalid ordinal value is used.
            Block defaultBlock = new Block();
            LocalVariable bf = new LocalVariable("bf", JavaTypeName.STRING_BUILDER);
            defaultBlock.addStatement(new LocalVariableDeclaration (bf, new ClassInstanceCreationExpression(JavaTypeName.STRING_BUILDER)));
            LiteralWrapper badValueMessageWrapper1 = LiteralWrapper.make("Invalid ordinal value of ");
            JavaExpression message = new MethodInvocation.Instance(bf, "append", badValueMessageWrapper1, JavaTypeName.STRING, JavaTypeName.STRING_BUILDER, MethodInvocation.InvocationType.VIRTUAL);
            message = new  MethodInvocation.Instance(message, "append", METHODVAR_ORDINAL, JavaTypeName.INT, JavaTypeName.STRING_BUILDER, MethodInvocation.InvocationType.VIRTUAL);
            LiteralWrapper badValueMessageWrapper2 = LiteralWrapper.make(" in " + className.toString() + ".getTagDC().");
            message = new MethodInvocation.Instance(message, "append", badValueMessageWrapper2, JavaTypeName.STRING, JavaTypeName.STRING_BUILDER, MethodInvocation.InvocationType.VIRTUAL);
            defaultBlock.addStatement (new ExpressionStatement(message));
            message = new MethodInvocation.Instance(bf, "toString", JavaTypeName.STRING, MethodInvocation.InvocationType.VIRTUAL);
            defaultBlock.addStatement (new ReturnStatement(new CastExpression(tagDCTypeName, new MethodInvocation.Static(JavaTypeNames.RTVALUE, "badValue", message, JavaTypeName.STRING, JavaTypeNames.RTVALUE))));
            ordSwitch.addCase(new SwitchStatement.DefaultCase (defaultBlock));

            // Add the switch statement to the method.
            javaMethod.addStatement(ordSwitch);
        }
View Full Code Here

            } else
            if (scheme == Scheme.UNBOX_INTERNAL_SCHEME) {
                methodName = methodName + "Unboxed";
            }

            Block bodyBlock = javaDefn.genS_LetVarDef(scheme, (LECCLiftedLetVarMachineFunction)mf);


            // Figure out the arg names and types.
            String[] argNames = new String[arity + 1];
            JavaTypeName[] argTypes = new JavaTypeName[arity + 1];
View Full Code Here

            if (functions.getNCAFs() + functions.getNZeroArityFunctions() <= 1) {
                for (final MachineFunction mf : functions.getTopLevelCALFunctions()) {
                    JavaField instanceField = new JavaField.Static(className, CALToJavaNames.getInstanceFieldName(mf.getQualifiedName(), module), className);

                    if (mf.isCAF()) {
                        Block b = new Block();
                        // This is a CAF (constant applicative form) we want to use the cached instance associated
                        // with the execution context, if it exists.
                        // If it doesn't exist we will create an instance and add it to the cache.

                        String instanceMapFieldName = functions.getFNamePrefix(mf.getName()) + "$instancesMap";
                        JavaField instanceMapField =
                            new JavaField.Static(className, instanceMapFieldName, JavaTypeName.MAP);

                        // RTFunction newInstance = (RTFunction)$instancesMap.get($ec);
                        JavaExpression.LocalVariable newInstanceVar =
                            new JavaExpression.LocalVariable("newInstance", returnType);
                        JavaExpression initializer = new JavaExpression.CastExpression(
                                returnType,
                                new MethodInvocation.Instance(
                                        instanceMapField,
                                        "get",
                                        SCJavaDefn.EXECUTION_CONTEXT_VAR,
                                        JavaTypeName.OBJECT,
                                        JavaTypeName.OBJECT,
                                        MethodInvocation.InvocationType.INTERFACE));
                        JavaStatement decl = new JavaStatement.LocalVariableDeclaration(newInstanceVar, initializer);
                        b.addStatement(decl);

                        // If no instance exists for the execution context create one and cache it.

                        // newInstance == null
                        JavaExpression comparison = new JavaExpression.OperatorExpression.Binary(JavaOperator.EQUALS_OBJECT, newInstanceVar, JavaExpression.LiteralWrapper.NULL);

                        // newInstance = new RTFullApp.General_0($instance);
                        // $instancesMap.put($ec, newInstance);
                        JavaStatement.Block then = new JavaStatement.Block();
                        then.addStatement(new ExpressionStatement(new JavaExpression.Assignment(newInstanceVar, new JavaExpression.ClassInstanceCreationExpression(_0TypeName, instanceField, JavaTypeNames.RTSUPERCOMBINATOR))));
                        JavaExpression cacheValue = new MethodInvocation.Instance(
                                instanceMapField,
                                "put",
                                new JavaExpression[] {
                                        SCJavaDefn.EXECUTION_CONTEXT_VAR,
                                        newInstanceVar },
                                new JavaTypeName[] {
                                        JavaTypeName.OBJECT,
                                        JavaTypeName.OBJECT },
                                JavaTypeName.OBJECT,
                                MethodInvocation.InvocationType.INTERFACE);
                        then.addStatement(new ExpressionStatement(cacheValue));

                        // Put the whole if expression together.
                        JavaStatement ifthen = new JavaStatement.IfThenElseStatement(comparison, then);
                        b.addStatement(ifthen);
                        b.addStatement(new ReturnStatement(newInstanceVar));

                        javaMethod.addStatement(b);
                        break;
                    } else if (mf.getArity() == 0) {

                        Block b = new Block();

                        // This is an unsafe method.  i.e. a non-CAF function of arity zero.  Since the
                        // function can have side effects we need to create a new instance of the class
                        // each time so that a previously evaluated value doesn't get re-used in place
                        // of actually executing the function.
                        JavaExpression.LocalVariable newInstanceVar = new JavaExpression.LocalVariable("newInstance", returnType);
                        JavaExpression initializer = new ClassInstanceCreationExpression(_0TypeName, instanceField, JavaTypeNames.RTSUPERCOMBINATOR);
                        JavaStatement decl = new JavaStatement.LocalVariableDeclaration(newInstanceVar, initializer);
                        b.addStatement(decl);
                        b.addStatement(new ReturnStatement(newInstanceVar));

                        javaMethod.addStatement(b);
                        break;
                    }
                }

            } else {
                SwitchStatement switchStatement =
                    new SwitchStatement(new MethodVariable("scIndex"));

                for (final MachineFunction mf : functions.getTopLevelCALFunctions()) {
                    JavaField instanceField = new JavaField.Static(className, CALToJavaNames.getInstanceFieldName(mf.getQualifiedName(), module), className);
                    int functionIndex = functions.getFunctionIndex(mf.getName());
                    if (mf.isCAF()) {

                        Block b = new Block();
                        // This is a CAF (constant applicative form) we want to use the cached instance associated
                        // with the execution context, if it exists.
                        // If it doesn't exist we will create an instance and add it to the cache.

                        String instanceMapFieldName = functions.getFNamePrefix(mf.getName()) + "$instancesMap";
                        JavaField instanceMapField =
                            new JavaField.Static(className, instanceMapFieldName, JavaTypeName.MAP);


                        // RTFunction newInstance = (RTFunction)$instancesMap.get($ec);
                        JavaExpression.LocalVariable newInstanceVar = new JavaExpression.LocalVariable("newInstance", returnType);
                        JavaExpression initializer =
                                new JavaExpression.CastExpression(returnType, new MethodInvocation.Instance (instanceMapField,
                                                    "get",
                                                    SCJavaDefn.EXECUTION_CONTEXT_VAR,
                                                    JavaTypeName.OBJECT,
                                                    JavaTypeName.OBJECT,
                                                    MethodInvocation.InvocationType.INTERFACE));
                        JavaStatement decl = new JavaStatement.LocalVariableDeclaration(newInstanceVar, initializer);
                        b.addStatement(decl);

                        // If no instance exists for the execution context create one and cache it.

                        // newInstance == null
                        JavaExpression comparison = new JavaExpression.OperatorExpression.Binary(JavaOperator.EQUALS_OBJECT, newInstanceVar, JavaExpression.LiteralWrapper.NULL);

                        // newInstance = new RTFullApp.General_0($instance);
                        // $instancesMap.put($ec, newInstance);
                        JavaStatement.Block then = new JavaStatement.Block();
                        then.addStatement(new ExpressionStatement(new JavaExpression.Assignment(newInstanceVar, new JavaExpression.ClassInstanceCreationExpression(_0TypeName, instanceField, JavaTypeNames.RTSUPERCOMBINATOR))));
                        JavaExpression cacheValue =
                            new MethodInvocation.Instance(instanceMapField,
                                                 "put",
                                                 new JavaExpression[]{SCJavaDefn.EXECUTION_CONTEXT_VAR, newInstanceVar},
                                                 new JavaTypeName[]{JavaTypeName.OBJECT, JavaTypeName.OBJECT},
                                                 JavaTypeName.OBJECT,
                                                 MethodInvocation.InvocationType.INTERFACE);
                        then.addStatement(new ExpressionStatement(cacheValue));

                        // Put the whole if expression together.
                        JavaStatement ifthen = new JavaStatement.IfThenElseStatement(comparison, then);
                        b.addStatement(ifthen);
                        b.addStatement(new ReturnStatement(newInstanceVar));

                        switchStatement.addCase(
                                new SwitchStatement.IntCaseGroup(
                                        functionIndex,
                                        b));
View Full Code Here

                        }
                    }
                }

                //Add the body
                Block bodyBlock = javaDefn.genS_SC_Boxed();

                if (javaDefn.isTailRecursive()) {

                    Block loopBodyBlock = new Block();

                    if (!LECCMachineConfiguration.nonInterruptibleRuntime()) {
                        // Add a check of the quit flag at the top of the loop body.
                        loopBodyBlock.addStatement(checkForQuit());
                    }

                    if (LECCMachineConfiguration.SANITY_CHECK_LET_VARS) {
                        loopBodyBlock.addStatement(resetLetVarFlags(javaDefn.getFunctionName()));

                    }

                    if (LECCMachineConfiguration.generateDebugCode()) {
                        loopBodyBlock.addStatement(generateDebugCode(javaDefn, unboxedLocalVarNames, unboxedLocalVarTypes));
                    }

                    loopBodyBlock.addStatement(bodyBlock);
                    UnconditionalLoop whileStatement = new UnconditionalLoop (SCJavaDefn.TAIL_RECURSION_LOOP_LABEL, loopBodyBlock);
                    javaMethod.addStatement (whileStatement);

                } else {
                    if (LECCMachineConfiguration.SANITY_CHECK_LET_VARS) {
View Full Code Here

         * usage.
         * @param originatingFunction
         * @return the code block that resets the flags.
         */
        private Block resetLetVarFlags(String originatingFunction) {
            Block b = new Block();
            if (LECCMachineConfiguration.SANITY_CHECK_LET_VARS) {
                Set<String> liftedFunctions = functions.getLiftedFunctionsFor(originatingFunction);
                if (liftedFunctions != null) {
                    for (final String liftedFunctionName : liftedFunctions) {
                        String flagName = CALToJavaNames.cleanSCName(liftedFunctionName) + "_flag_";

                        b.addStatement(new ExpressionStatement(new JavaExpression.Assignment(new JavaField.Instance(null, flagName, JavaTypeName.BOOLEAN), LiteralWrapper.make(Boolean.FALSE))));
                    }
                }
            }

            return b;
View Full Code Here

         * @param javaDefn
         * @return A block which extracts the function arguments from an application chain.
         * @throws CodeGenerationException
         */
        private JavaStatement generateArgumentExtractors (SCJavaDefn javaDefn) throws CodeGenerationException {
            final Block argExtractorBlock = new Block();

            // Extract the arguments from the application chain.
            final int arity = javaDefn.getArity();

            if (arity > 0) {
                argExtractorBlock.addStatement(new LineComment("Arguments"));
            }

            // Add argument extractors
            for (int i = arity - 1; i >= 0; i--) {

                // The name used for the extracted variable depends on whether the argument is of primitive type
                // and strict.  If it is we append $L so that the actual name can be used for the unboxed primitive value.

                final String fixedUpVarName;
                {
                    String basicVarName = javaDefn.getJavaArgumentName(i);
                    if (javaDefn.isArgStrict(i) && javaDefn.isArgUnboxable(i)) {
                        fixedUpVarName = basicVarName + "$L";
                    } else {
                        fixedUpVarName = basicVarName;
                    }
                }

                final JavaExpression initializer;

                if (i == arity - 1) {
                    //$rootNode.getArgValue();
                    initializer = SCJavaDefn.createInvocation(METHODVAR_ROOT_NODE, SCJavaDefn.GETARGVALUE);

                } else if (i == arity - 2) {

                    if (arity > 2) {
                        //RTValue $currentRootNode;
                        argExtractorBlock.addStatement(new LocalVariableDeclaration(LOCALVAR_CURRENT_ROOT_NODE));
                        //($currentRootNode = $rootNode.prevArg()).getArgValue();
                        initializer =
                            SCJavaDefn.createInvocation(
                                new Assignment(LOCALVAR_CURRENT_ROOT_NODE, SCJavaDefn.createInvocation(METHODVAR_ROOT_NODE, SCJavaDefn.PREVARG)),
                                SCJavaDefn.GETARGVALUE);
                    } else {
                        //$rootNode.prevArg().getArgValue();
                        initializer =
                            SCJavaDefn.createInvocation(
                                SCJavaDefn.createInvocation(METHODVAR_ROOT_NODE, SCJavaDefn.PREVARG),
                                SCJavaDefn.GETARGVALUE);
                    }

                } else if (i == 0) {

                    //$currentRootNode.prevArg().getArgValue();
                    initializer =
                        SCJavaDefn.createInvocation(
                            SCJavaDefn.createInvocation(LOCALVAR_CURRENT_ROOT_NODE, SCJavaDefn.PREVARG),
                            SCJavaDefn.GETARGVALUE);

                } else {

                    //($currentRootNode = $currentRootNode.prevArg()).getArgValue();
                    initializer =
                        SCJavaDefn.createInvocation(
                            new Assignment(LOCALVAR_CURRENT_ROOT_NODE, SCJavaDefn.createInvocation(LOCALVAR_CURRENT_ROOT_NODE, SCJavaDefn.PREVARG)),
                            SCJavaDefn.GETARGVALUE);
                }

                LocalVariableDeclaration varDecl = new LocalVariableDeclaration(new LocalVariable(fixedUpVarName, JavaTypeNames.RTVALUE), initializer);

                argExtractorBlock.addStatement(varDecl);
            }

            // Make a call on the root node to free its member fields.
            // This frees them up for potential garbage collection.

            JavaStatement comment =
                new JavaStatement.LineComment("Release the fields in the root node to open them to garbage collection");
            argExtractorBlock.addStatement(comment);

            JavaExpression clearMembers =
                new MethodInvocation.Instance(
                        new MethodVariable(ROOT_NODE),
                        "clearMembers",
                        JavaTypeName.VOID,
                        MethodInvocation.InvocationType.VIRTUAL);
            argExtractorBlock.addStatement(new ExpressionStatement(clearMembers));

            return argExtractorBlock;
        }
View Full Code Here

            // Figure out the methodName
            final int arity = javaDefn.getArity();
            String methodName = functions.getFnNamePrefix(javaDefn.getFunctionName()) + "f" + arity + "S";

            Block bodyBlock = javaDefn.genS_SC_Boxed();

            // Figure out the arg names and types.
            String[] argNames = new String[arity + 1];
            JavaTypeName[] argTypes = new JavaTypeName[arity + 1];

            // Default type of argument is RTValue
            Arrays.fill(argTypes, JavaTypeNames.RTVALUE);

            // Fill in the argument names from the SC definition.
            for (int i =  0; i < arity; ++i) {
                argNames[i] = javaDefn.getJavaArgumentName(i);
            }

            // The last argument is the execution context.
            argNames[arity] = SCJavaDefn.EXECUTION_CONTEXT_NAME;
            argTypes[arity] = JavaTypeNames.RTEXECUTION_CONTEXT;

            // Try to get type info for this SC.
            for (int i = 0; i < arity; ++i) {
                if (javaDefn.isArgStrict(i) && javaDefn.isArgUnboxable(i)) {
                    argTypes[i] = javaDefn.getArgumentTypeName(i);
                }
            }

            // Add the method to the class.
            JavaMethod javaMethod = new JavaMethod(modifiers, JavaTypeNames.RTVALUE, argNames, argTypes, null, methodName);
            javaClassRep.addMethod(javaMethod);

            // Add the throws declaration
            javaMethod.addThrows(JavaTypeName.CAL_EXECUTOR_EXCEPTION);

            JavaDocComment comment = new JavaDocComment(methodName);
            comment.addLine("This method implements the function logic of the CAL function " + javaDefn.getModuleName() + "." + javaDefn.getFunctionName());
            javaMethod.setJavaDocComment(comment);

            // Add statistics generation.
            addStatsBlock (javaMethod, javaDefn);

            // Add the body
            if (javaDefn.isTailRecursive()) {

                Block loopBodyBlock = new Block();

                if (!LECCMachineConfiguration.nonInterruptibleRuntime()) {
                    // Add a check of the quit flag at the top of the loop body.
                    loopBodyBlock.addStatement(checkForQuit());
                }

                if (LECCMachineConfiguration.SANITY_CHECK_LET_VARS) {
                    loopBodyBlock.addStatement(resetLetVarFlags(javaDefn.getFunctionName()));
                }

                if (LECCMachineConfiguration.generateDebugCode()) {
                    loopBodyBlock.addStatement(generateDebugCode(javaDefn, argNames, argTypes));
                }

                loopBodyBlock.addStatement(bodyBlock);
                UnconditionalLoop whileStatement = new UnconditionalLoop (SCJavaDefn.TAIL_RECURSION_LOOP_LABEL, loopBodyBlock);
                javaMethod.addStatement (whileStatement);
            } else {

                if (LECCMachineConfiguration.SANITY_CHECK_LET_VARS) {
View Full Code Here

            String methodName = functions.getFnNamePrefix(javaDefn.getFunctionName()) + "fUnboxed";
            if (arity > 0) {
                methodName = methodName + arity + "S";
            }

            Block bodyBlock = javaDefn.genS_SC_Unboxed();

            // Figure out the arg names and types.
            String[] argNames = new String[arity + 1];
            JavaTypeName[] argTypes = new JavaTypeName[arity + 1];

            // Default type of argument is RTValue
            Arrays.fill(argTypes, JavaTypeNames.RTVALUE);

            // Fill in the argument names from the SC definition.
            for (int i =  0; i < arity; ++i) {
                argNames[i] = javaDefn.getJavaArgumentName(i);
            }

            // The last argument is the execution context.
            argNames[arity] = SCJavaDefn.EXECUTION_CONTEXT_NAME;
            argTypes[arity] = JavaTypeNames.RTEXECUTION_CONTEXT;

            // Try to get type info for this SC.
            for (int i = 0; i < arity; ++i) {
                if (javaDefn.isArgStrict(i) && javaDefn.isArgUnboxable(i)) {
                    argTypes[i] = javaDefn.getArgumentTypeName(i);
                }
            }

            // Add the method to the class.
            JavaMethod javaMethod = new JavaMethod(modifiers, returnType, argNames, argTypes, null, methodName);
            javaClassRep.addMethod(javaMethod);

            // Add a comment indicating which CAL function this
            // corresponds to.
            JavaDocComment comment = new JavaDocComment(methodName);
            comment.addLine("This method implements the logic of the CAL function " + javaDefn.getModuleName() + "." + javaDefn.getFunctionName());
            comment.addLine("This version of the logic returns an unboxed value.");
            javaMethod.setJavaDocComment(comment);

            // Add the throws declaration
            javaMethod.addThrows(JavaTypeName.CAL_EXECUTOR_EXCEPTION);

            // Add statistics generation.
            addStatsBlock (javaMethod, javaDefn);

            // Add the body
            if (javaDefn.isTailRecursive()) {

                Block loopBodyBlock = new Block();

                if (!LECCMachineConfiguration.nonInterruptibleRuntime()) {
                    // Add a check of the quit flag at the top of the loop body.
                    loopBodyBlock.addStatement(checkForQuit());
                }

                if (LECCMachineConfiguration.SANITY_CHECK_LET_VARS) {
                    loopBodyBlock.addStatement(resetLetVarFlags(javaDefn.getFunctionName()));
                }

                if (LECCMachineConfiguration.generateDebugCode()) {
                    loopBodyBlock.addStatement(generateDebugCode(javaDefn, argNames, argTypes));
                }

                loopBodyBlock.addStatement(bodyBlock);
                UnconditionalLoop whileStatement = new UnconditionalLoop (SCJavaDefn.TAIL_RECURSION_LOOP_LABEL, loopBodyBlock);
                javaMethod.addStatement (whileStatement);
            } else {

                if (LECCMachineConfiguration.SANITY_CHECK_LET_VARS) {
View Full Code Here

                javaMethod.addStatement(new JavaStatement.ReturnStatement(mi));

            } else {

                Block bodyBlock = javaDefn.genS_SC_Boxed();

                // Add statistics generation.
                addStatsBlock (javaMethod, javaDefn);

                javaMethod.addStatement(generateStrictArgEvaluationBlock(javaDefn));

                String[] unboxedLocalVarNames = null;
                JavaTypeName[] unboxedLocalVarTypes = null;
                if (LECCMachineConfiguration.generateDebugCode() || LECCMachineConfiguration.generateDebugCode()) {
                    unboxedLocalVarNames = new String[arity];
                    unboxedLocalVarTypes = new JavaTypeName[arity];
                    for (int i = 0; i < arity; ++i) {
                        unboxedLocalVarNames[i] = javaDefn.getJavaArgumentName(i);
                        if (javaDefn.isArgStrict(i) && javaDefn.isArgUnboxable(i)) {
                            unboxedLocalVarTypes[i] = javaDefn.getArgumentTypeName(i);
                        } else {
                            unboxedLocalVarTypes[i] = JavaTypeNames.RTVALUE;
                        }
                    }
                }

                // Add the body
                if (javaDefn.isTailRecursive()) {
                    Block loopBodyBlock = new Block();

                    if (!LECCMachineConfiguration.nonInterruptibleRuntime()) {
                        // Add a check of the quit flag at the top of the loop body.
                        loopBodyBlock.addStatement(checkForQuit());
                    }

                    if (LECCMachineConfiguration.SANITY_CHECK_LET_VARS) {
                        loopBodyBlock.addStatement(resetLetVarFlags(javaDefn.getFunctionName()));
                    }

                    if (LECCMachineConfiguration.generateDebugCode()) {
                        loopBodyBlock.addStatement(generateDebugCode(javaDefn, unboxedLocalVarNames, unboxedLocalVarTypes));
                    }

                    loopBodyBlock.addStatement(bodyBlock);
                    UnconditionalLoop whileStatement = new UnconditionalLoop (SCJavaDefn.TAIL_RECURSION_LOOP_LABEL, loopBodyBlock);
                    javaMethod.addStatement (whileStatement);
                } else {

                    if (LECCMachineConfiguration.SANITY_CHECK_LET_VARS) {
View Full Code Here

TOP

Related Classes of org.openquark.cal.internal.javamodel.JavaStatement.Block

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.