Package org.openquark.cal.internal.javamodel

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


                JavaExpression assign = new JavaExpression.Assignment(flag, LiteralWrapper.make(Boolean.TRUE));
                javaMethod.addStatement(new ExpressionStatement(assign));
            }

            // Add the body
            javaMethod.addStatement(bodyBlock);

            return javaMethod;
        }

        /**
 
View Full Code Here


                switchStatement.addCase(
                    new SwitchStatement.IntCaseGroup(functions.getFunctionIndex(javaDefn.getFunctionName()), new ReturnStatement(mi)));
            }

            javaMethod.addStatement(switchStatement);

            // Handle the fallthrough.
            // If this is the lazy version of the 'f' method we want to defer to the
            // version in the superclass (i.e. RTValue).  This can occur when there
            // is a lazy application of a functional argument, or an oversaturation.
View Full Code Here

                    new MethodInvocation.Static (JavaTypeNames.RTVALUE,
                                                   "badValue",
                                                   LiteralWrapper.make("Bad scTag in 'f'."),
                                                   JavaTypeName.STRING,
                                                   JavaTypeNames.RTVALUE);
                javaMethod.addStatement(new ReturnStatement(mi));
            } else {
                MethodInvocation mi =
                    new MethodInvocation.Instance(
                            null,
                            "f" + arity + "L",
View Full Code Here

                            argValues,
                            argTypes,
                            JavaTypeNames.RTVALUE,
                            MethodInvocation.InvocationType.SPECIAL);

                javaMethod.addStatement(new JavaStatement.LineComment("This is an oversaturated lazy application."));
                javaMethod.addStatement(new JavaStatement.LineComment("Usually this occurs when dealing with a lazy application of a function type argument."));
                javaMethod.addStatement(new JavaStatement.LineComment("Defer to the base implementation in the super class."));

                javaMethod.addStatement(new ReturnStatement(mi));
            }
View Full Code Here

                            argTypes,
                            JavaTypeNames.RTVALUE,
                            MethodInvocation.InvocationType.SPECIAL);

                javaMethod.addStatement(new JavaStatement.LineComment("This is an oversaturated lazy application."));
                javaMethod.addStatement(new JavaStatement.LineComment("Usually this occurs when dealing with a lazy application of a function type argument."));
                javaMethod.addStatement(new JavaStatement.LineComment("Defer to the base implementation in the super class."));

                javaMethod.addStatement(new ReturnStatement(mi));
            }
        }
View Full Code Here

                            JavaTypeNames.RTVALUE,
                            MethodInvocation.InvocationType.SPECIAL);

                javaMethod.addStatement(new JavaStatement.LineComment("This is an oversaturated lazy application."));
                javaMethod.addStatement(new JavaStatement.LineComment("Usually this occurs when dealing with a lazy application of a function type argument."));
                javaMethod.addStatement(new JavaStatement.LineComment("Defer to the base implementation in the super class."));

                javaMethod.addStatement(new ReturnStatement(mi));
            }
        }
View Full Code Here

                javaMethod.addStatement(new JavaStatement.LineComment("This is an oversaturated lazy application."));
                javaMethod.addStatement(new JavaStatement.LineComment("Usually this occurs when dealing with a lazy application of a function type argument."));
                javaMethod.addStatement(new JavaStatement.LineComment("Defer to the base implementation in the super class."));

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

        private void createMethod_fSwitching () {
View Full Code Here

                    new SwitchStatement.IntCaseGroup(
                            functions.getFunctionIndex(mf.getName()),
                            new ReturnStatement(mi)));
            }

            javaMethod.addStatement(switchStatement);

            // Handle the fallthrough.
            final MethodInvocation mi =
                new MethodInvocation.Static (JavaTypeNames.RTVALUE,
                                               "badValue",
View Full Code Here

                new MethodInvocation.Static (JavaTypeNames.RTVALUE,
                                               "badValue",
                                               LiteralWrapper.make("Bad scTag in 'f'."),
                                               JavaTypeName.STRING,
                                               JavaTypeNames.RTVALUE);
            javaMethod.addStatement(new ReturnStatement(mi));
        }

        /**
         * Get the object representation for a Java class representing the function for this class.
         * This will not have any inner class info set.
View Full Code Here

                                                             "remove",
                                                             new JavaExpression[]{SCJavaDefn.EXECUTION_CONTEXT_VAR},
                                                             new JavaTypeName[]{JavaTypeName.OBJECT},
                                                             JavaTypeName.OBJECT,
                                                             MethodInvocation.InvocationType.INTERFACE);
                javaMethod.addStatement (new ExpressionStatement(remove));
            }
        }

        /**
         * Create the make() method.
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.