Package org.openquark.cal.internal.javamodel

Examples of org.openquark.cal.internal.javamodel.JavaClassRep.addMethod()


                if (!mf.getParameterStrictness()[i] || !SCJavaDefn.canTypeBeUnboxed(mf.getParameterTypes()[i])) {
                    Assignment a = new Assignment(functionArgumentMemberFields[i], LiteralWrapper.NULL);
                    clearMembers.addStatement(new ExpressionStatement(a));
                }
            }
            strictAppClassRep.addMethod (clearMembers);

            createAppClass_debugMethods(strictAppClassRep, functionArgumentMemberFields);

            // We need to mark this class as containing assertions.
            // This is done manually because we don't always
View Full Code Here


            // Add the constructor.
            lazyAppClassRep.addConstructor(createLazyAppClass_constructor(mf, functionField, functionArgumentMemberFields));

            // Add the reduce method.
            lazyAppClassRep.addMethod(createLazyAppClass_method_reduce(mf, functionField, lazyAppTypeName, functionArgumentMemberFields));

            // Add the clearMembers() method.
            JavaMethod clearMembers = new JavaMethod (Modifier.PUBLIC | Modifier.FINAL, JavaTypeName.VOID, "clearMembers");
            //the line "function = null;" should not be added to clearMembers. function is a reference to a singleton
            //so that clearing it doesn't actually free any memory. However, not clearing it means that the the method
View Full Code Here

            //clearMembers.addStatement(new ExpressionStatement(new Assignment(functionField, LiteralWrapper.NULL)));
            for (int i = 0; i < functionArgumentMemberFields.length; ++i) {
                Assignment a = new Assignment(functionArgumentMemberFields[i], LiteralWrapper.NULL);
                clearMembers.addStatement(new ExpressionStatement(a));
            }
            lazyAppClassRep.addMethod (clearMembers);

            createAppClass_debugMethods(lazyAppClassRep, functionArgumentMemberFields);

            // We need to mark this class as containing assertions.
            // This is done manually because we don't always
View Full Code Here

                        new JavaExpression.ClassInstanceCreationExpression(
                            JavaTypeNames.RTDATA_OPAQUE, new JavaExpression.MethodVariable(ARGS_PARAMETER_NAME), JavaTypeName.OBJECT))), executionContextLocalVar);
       
        mainMethod.addStatement(new JavaStatement.ExpressionStatement(runExpr));
       
        classRep.addMethod(mainMethod);
       
        // We are finished with building the class.
        return classRep;
    }
View Full Code Here

                    final ClassTypeInfo returnType = argTypesAndReturnType.snd();
                   
                    final JavaMethod unboxedArgsVariant =
                        makeLibraryMethod(module, functionalAgent, functionalAgentType, argTypes, returnType, scopedEntityNamingPolicy, crossRefGen, methodNameMapping);
                   
                    classRep.addMethod(unboxedArgsVariant);
                   
                    if (hasNonCalValueArgument(argTypes)) {
                        // The first method has at least one unboxed/foreign argument, so we create a second version
                        // that takes all arguments as CalValues
                       
View Full Code Here

                        }
                       
                        final JavaMethod calValueArgsVariant =
                            makeLibraryMethod(module, functionalAgent, functionalAgentType, calValueArgTypes, returnType, scopedEntityNamingPolicy, crossRefGen, methodNameMapping);
                       
                        classRep.addMethod(calValueArgsVariant);
                    }
                } else {
                    // Report that the functional agent was skipped because its type contains type class constraints
                    if (functionalAgent instanceof ClassMethod) {
                        monitor.skippingClassMethod(functionalAgent.getName());
View Full Code Here

                configCheckFailureBody,
                configCheckSuccessBody);
       
        checkConfigMethod.addStatement(configCheck);
       
        classRep.addMethod(checkConfigMethod);

        // Code fragment:
        //
        // private static final boolean isCompatibleWithCurrentConfiguration = __checkConfig();
        //
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.