Package org.openquark.cal.internal.javamodel

Examples of org.openquark.cal.internal.javamodel.JavaMethod.addThrows()


                new boolean[] {true, true},
                "f");
            javaClassRep.addMethod(javaMethod);

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

            if (LECCMachineConfiguration.generateCallCounts()) {
                JavaExpression args[] = new JavaExpression[2];
                JavaTypeName argTypes[] = new JavaTypeName[2];
                args[0] = LiteralWrapper.make(dc.getName().getModuleName().toSourceText());
View Full Code Here


            // Add the method to the class.
            JavaMethod javaMethod = new JavaMethod(modifiers, returnType, argNames, argTypes, null, "f" + dc.getArity() + "L");
            javaClassRep.addMethod(javaMethod);

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

            if (LECCMachineConfiguration.generateCallCounts()) {
                JavaExpression args[] = new JavaExpression[2];
                JavaTypeName ccArgTypes[] = new JavaTypeName[2];
                args[0] = LiteralWrapper.make(dc.getName().getModuleName().toSourceText());
View Full Code Here

                // don't need an RTExecutionContext passed to the getter.
                javaMethod = new JavaMethod (modifiers, returnType, methodName);
                javaClassRep.addMethod(javaMethod);

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

                if (fieldStrictness[i]) {
                    jf = new JavaField.Instance (null, javaFieldNames[i], returnType);
                } else {
                    // This is an error.  We should only get to this point if all
View Full Code Here

                            (forType == null) ? JavaTypeNames.RTVALUE : forType,
                            new String[]{"dcOrdinal", "fieldIndex", "errorInfo"},
                            new JavaTypeName[]{JavaTypeName.INT, JavaTypeName.INT, JavaTypeName.ERRORINFO},
                            null, methodName);

                javaMethod.addThrows(JavaTypeName.CAL_EXECUTOR_EXCEPTION);

                javaClassRep.addMethod (javaMethod);
                javaMethod.addStatement(methodBodyBlock);
            }
View Full Code Here

            JavaMethod javaMethod;
            // Don't need to pass in an execution context as this will always be evaluted.
            javaMethod = new JavaMethod(modifiers, fieldType, methodName);

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

            javaClassRep.addMethod(javaMethod);

            if (implementAtThisLevel && isStrict) {
                JavaField field = new JavaField.Instance (null, fieldName, fieldType);
View Full Code Here

                                                JavaTypeNames.RTVALUE,
                                                SCJavaDefn.EXECUTION_CONTEXT_NAME,
                                                JavaTypeNames.RTEXECUTION_CONTEXT,
                                                false, "reduce");
            // Add the throws declaration
            reduce.addThrows(JavaTypeName.CAL_EXECUTOR_EXCEPTION);

           // Add the body.
            // if (result == null) {
            //     setResult (
            //         function.f4L(RTValue.lastRef(arg1, arg1 = null), ...));
View Full Code Here

                returnType = SCJavaDefn.typeExprToTypeName(mf.getResultType());
            }
            JavaMethod javaMethod = new JavaMethod(modifiers, returnType, argNames, argTypes, null, methodName);

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

            // If we are doing a sanity check on let variable behaviour we
            // want to check/set the flag associated with this method.
            if (LECCMachineConfiguration.SANITY_CHECK_LET_VARS) {
                JavaField flag = new JavaField.Instance(null, CALToJavaNames.cleanSCName(javaDefn.getFunctionName()) + "_flag_", JavaTypeName.BOOLEAN);
View Full Code Here

            String methodName = "f" + arity + (strict ? "S" : "L");
            JavaMethod javaMethod = new JavaMethod(modifiers, JavaTypeNames.RTVALUE, argNames, argTypes, null, methodName);
            javaClassRep.addMethod(javaMethod);

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

            // At this point we want to switch based on the scTag and dispatch to the appropriate
            // sc specific f method.
            SwitchStatement switchStatement =
                new SwitchStatement(new JavaField.Instance(null, SCDefinitionBuilder.functionTagFieldName, JavaTypeName.INT));
View Full Code Here

            final JavaMethod javaMethod = new JavaMethod(modifiers, JavaTypeNames.RTVALUE, argNames, argTypes, argFinal, methodName);
            javaClassRep.addMethod(javaMethod);

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

            // At this point we want to switch based on the scTag and dispatch to the appropriate
            // sc specific f method.
            SwitchStatement switchStatement =
                new SwitchStatement(new JavaField.Instance(null, SCDefinitionBuilder.functionTagFieldName, JavaTypeName.INT));
View Full Code Here

                final String methodName = methodNamePrefix + "f";

                javaMethod = new JavaMethod(modifiers, JavaTypeNames.RTVALUE, argNames, argTypes, argFinal, methodName);

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

                final JavaDocComment comment = new JavaDocComment(methodName);
                comment.addLine("This method implements the function logic of the CAL function " + javaDefn.getModuleName() + "." + javaDefn.getFunctionName());
                javaMethod.setJavaDocComment(comment);
            }
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.