Package org.openquark.cal.internal.javamodel.JavaExpression

Examples of org.openquark.cal.internal.javamodel.JavaExpression.MethodVariable


            //    throw new IndexOutOfBoundsException();
            //}

            JavaMethod method = new JavaMethod (Modifier.PUBLIC | Modifier.FINAL, JavaTypeName.STRING, "childN", JavaTypeName.INT, false, "debug_getChildPrefixText");

            MethodVariable childNVar = new JavaExpression.MethodVariable("childN");

            {
                //    if (result != null) {
                //        return super.debug_getChildPrefixText(childN);
                //    }
View Full Code Here


            if (addEC) {
                constructorArgs[constructorArgs.length - 1] = SCJavaDefn.EXECUTION_CONTEXT_VAR;
            }

            for (int i = 0; i < dc.getArity(); ++i) {
                constructorArgs[i] = new MethodVariable("member" + i);
                if (fieldStrictness[i]) {
                    constructorArgs[i] = new MethodInvocation.Instance (constructorArgs[i],
                                                    "evaluate",
                                                    SCJavaDefn.EXECUTION_CONTEXT_VAR,
                                                    JavaTypeNames.RTEXECUTION_CONTEXT,
View Full Code Here

            // Check that this is an instance of the expected data constructor.
            MethodInvocation checkDC =
                new MethodInvocation.Instance(
                        null,
                        "checkDCOrdinalForFieldSelection",
                        new JavaExpression[]{new MethodVariable("dcOrdinal"), new MethodVariable("errorInfo")},
                        new JavaTypeName[]{JavaTypeName.INT, JavaTypeName.ERRORINFO},
                        JavaTypeName.VOID,
                        MethodInvocation.InvocationType.VIRTUAL);
            methodBodyBlock.addStatement(new ExpressionStatement(checkDC));
View Full Code Here

            //for strict primitive fields, we generate stuff like "return CAL_Int.make(field)" instead.

            JavaMethod method = new JavaMethod (Modifier.PUBLIC | Modifier.FINAL, JavaTypeName.CAL_VALUE, "childN", JavaTypeName.INT, false, "debug_getChild");
            javaClassRep.addMethod (method);

            MethodVariable childNVar = new JavaExpression.MethodVariable("childN");

            {
                //    if (isFunctionSingleton()) {
                //        throw new IndexOutOfBoundsException();
                //    }
View Full Code Here

                    "$dataConsExpr",
                    "$dcOrdinal",
                    "$fieldOrdinal",
                    "$errorInfo"};

            MethodVariable $dataConsExprVariable = new MethodVariable(argNames[0]);
            MethodVariable $dcOrdinalVariable = new MethodVariable(argNames[1]);
            MethodVariable $fieldOrdinalVariable = new MethodVariable(argNames[2]);
            MethodVariable $errorInfoVariable = new MethodVariable(argNames[3]);

            // Create the constructor.
            // In this case we simply pass the parameters to the superclass constructor.
            JavaConstructor constructor =
                new JavaConstructor (Modifier.PUBLIC,
View Full Code Here

            // Figure out arg names and create method variables.
            String[] argNames = new String[nArgs];
            MethodVariable[] argVars = new MethodVariable[nArgs];
            for (int i = 0, n = argNames.length; i < n; i++) {
                argNames[i] = "member" + i;
                argVars[i] = new MethodVariable(argNames[i]);
            }

            if (addEC) {
                argTypes[argTypes.length - 1] = JavaTypeNames.RTEXECUTION_CONTEXT;
                argNames[argNames.length - 1] = SCJavaDefn.EXECUTION_CONTEXT_NAME;
View Full Code Here

            // Figure out arg names and create method vars.
            String[] argNames = new String[nArgs];
            MethodVariable[] argVars = new MethodVariable[nArgs];
            for (int i = 0; i < argNames.length; i++) {
                argNames[i] = "member" + i;
                argVars[i] = new MethodVariable(argNames[i]);
            }

            if (addEC) {
                argTypes[argTypes.length - 1] = JavaTypeNames.RTEXECUTION_CONTEXT;
                argNames[argNames.length - 1] = SCJavaDefn.EXECUTION_CONTEXT_NAME;
View Full Code Here

            }
           
            case PrimOps.PRIMOP_MAKE_ITERATOR:
            {               
                //new RTCalListIterator(args[0], args[1], $ec)              
                JavaExpression[] arguments = new JavaExpression[] {args[0], args[1], new MethodVariable(SCJavaDefn.EXECUTION_CONTEXT_NAME)};
                JavaTypeName[] argTypes = new JavaTypeName[] {JavaTypeNames.RTVALUE, JavaTypeNames.RTVALUE, JavaTypeNames.RTEXECUTION_CONTEXT};              
                return new JavaExpression.ClassInstanceCreationExpression(JavaTypeNames.RTCAL_LIST_ITERATOR, arguments, argTypes);
            }           
           
            case PrimOps.PRIMOP_MAKE_COMPARATOR:
            {               
                //new RTComparator(args[0], $ec)              
                JavaExpression[] arguments = new JavaExpression[] {args[0], new MethodVariable(SCJavaDefn.EXECUTION_CONTEXT_NAME)};
                JavaTypeName[] argTypes = new JavaTypeName[] {JavaTypeNames.RTVALUE, JavaTypeNames.RTEXECUTION_CONTEXT};              
                return new JavaExpression.ClassInstanceCreationExpression(JavaTypeNames.RTCOMPARATOR, arguments, argTypes);
            }
           
            case PrimOps.PRIMOP_MAKE_EQUIVALENCE_RELATION:
            {
                //new RTEquivalenceRelation(args[0], $ec)               
                JavaExpression[] arguments = new JavaExpression[] {args[0], new MethodVariable(SCJavaDefn.EXECUTION_CONTEXT_NAME)};
                JavaTypeName[] argTypes = new JavaTypeName[] {JavaTypeNames.RTVALUE, JavaTypeNames.RTEXECUTION_CONTEXT};              
                return new JavaExpression.ClassInstanceCreationExpression(JavaTypeNames.RTEQUIVALENCE_RELATION, arguments, argTypes);                               
            }
           
            case PrimOps.PRIMOP_MAKE_CAL_FUNCTION:
            {               
                //new RTCalFunction(args[0], $ec)              
                JavaExpression[] arguments = new JavaExpression[] {args[0], new MethodVariable(SCJavaDefn.EXECUTION_CONTEXT_NAME)};
                JavaTypeName[] argTypes = new JavaTypeName[] {JavaTypeNames.RTVALUE, JavaTypeNames.RTEXECUTION_CONTEXT};              
                return new JavaExpression.ClassInstanceCreationExpression(JavaTypeNames.RTCAL_FUNCTION, arguments, argTypes);
            }           
           
            case PrimOps.PRIMOP_BITWISE_AND_INT: {
View Full Code Here

TOP

Related Classes of org.openquark.cal.internal.javamodel.JavaExpression.MethodVariable

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.