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

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


            //a result of setting the root node above.
            if (!mf.isTailRecursive()) {
                then.addStatement(new ExpressionStatement(new MethodInvocation.Instance(null, "clearMembers", JavaTypeName.VOID, MethodInvocation.InvocationType.VIRTUAL)));
            }

            reduce.addStatement(new IfThenElseStatement(condition, then));
            reduce.addStatement(new ReturnStatement(resultField));

            return reduce;
        }
View Full Code Here


            String fMethodName = functions.getFnNamePrefix(mf.getName()) + "f" + mf.getArity() + "L";
            MethodInvocation fn = new MethodInvocation.Instance (functionField, fMethodName, args, argTypes, JavaTypeNames.RTVALUE, MethodInvocation.InvocationType.VIRTUAL);
            MethodInvocation setResult = new MethodInvocation.Instance (null, "setResult", fn, JavaTypeNames.RTVALUE, JavaTypeName.VOID,  MethodInvocation.InvocationType.VIRTUAL);
            then.addStatement(new ExpressionStatement(setResult));

            reduce.addStatement(new IfThenElseStatement(condition, then));
            reduce.addStatement(new ReturnStatement(resultField));

            return reduce;
        }
View Full Code Here

                   Assignment localAssignment = new Assignment(localVariable, field);
                   InstanceOf checkType = new InstanceOf(localAssignment, JavaTypeNames.RTRESULT_FUNCTION);
                   MethodInvocation getValue = new MethodInvocation.Instance(localVariable, "getValue", JavaTypeNames.RTVALUE, MethodInvocation.InvocationType.VIRTUAL);
                   Assignment fieldAssignment = new Assignment(field, getValue);
                   ReturnStatement returnNewVal = new ReturnStatement(fieldAssignment);
                   IfThenElseStatement ifThen = new IfThenElseStatement(checkType, returnNewVal);
                   javaMethod.addStatement(ifThen);
                   javaMethod.addStatement(new ReturnStatement (localVariable));

               } else {
                   // The field is strict and therefore already in WHNF.
View Full Code Here

TOP

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

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.