Package org.openquark.cal.internal.javamodel

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


            // Add the body of the class.

            // private final int tag;
            JavaFieldDeclaration tagField = new JavaFieldDeclaration (Modifier.PRIVATE | Modifier.FINAL, JavaTypeName.INT, "tag", null);
            tagDCClassRep.addFieldDeclaration(tagField);

            // public TagDC(int tagVal) {this.tag = tagVal;}
            JavaConstructor javaConstructor = new JavaConstructor(Modifier.PUBLIC, new String[]{"tagVal"}, new JavaTypeName[]{JavaTypeName.INT}, "TagDC");
            tagDCClassRep.addConstructor(javaConstructor);
            Assignment tagAssign = new Assignment (new JavaField.Instance(null, "tag", JavaTypeName.INT), METHODVAR_TAGVAL);
View Full Code Here


            // Now instantiate the java class representation.
            JavaClassRep strictAppClassRep = new JavaClassRep(strictAppTypeName, superClassTypeName, classModifiers, interfaces);

            //add the function field, which is a reference to the function singleton.
            JavaFieldDeclaration functionFieldDec = new JavaFieldDeclaration (Modifier.PRIVATE | Modifier.FINAL, className, "function", null);
            strictAppClassRep.addFieldDeclaration(functionFieldDec);
            JavaField functionField = new JavaField.Instance (null, "function", className);

            // This class has a member field for each argument to the SC.
            JavaField[] functionArgumentMemberFields = new JavaField [mf.getArity()];
            for (int i = 0; i < mf.getArity(); ++i) {
View Full Code Here

                    field = new JavaField.Instance (null, fieldName, SCJavaDefn.typeExprToTypeName(mf.getParameterTypes()[i]));
                } else {
                    fieldDec = new JavaFieldDeclaration (Modifier.PRIVATE, JavaTypeNames.RTVALUE, fieldName, null);
                    field = new JavaField.Instance (null, fieldName, JavaTypeNames.RTVALUE);
                }
                strictAppClassRep.addFieldDeclaration(fieldDec);
                functionArgumentMemberFields[i] = field;
            }

            // Add the constructor
            strictAppClassRep.addConstructor(createStrictAppClass_constructor(mf, functionField, functionArgumentMemberFields));
View Full Code Here

            // Now instantiate the java class representation.
            JavaClassRep lazyAppClassRep = new JavaClassRep(lazyAppTypeName, superClassTypeName, classModifiers, interfaces);

            //add the function field, which is a reference to the function singleton.
            JavaFieldDeclaration functionFieldDec = new JavaFieldDeclaration (Modifier.PRIVATE | Modifier.FINAL, className, "function", null);
            lazyAppClassRep.addFieldDeclaration(functionFieldDec);
            JavaField functionField = new JavaField.Instance (null, "function", className);

            // This class has a member field for each argument to the SC.
            JavaField[] functionArgumentMemberFields = new JavaField [mf.getArity()];
            for (int i = 0; i < mf.getArity(); ++i) {
View Full Code Here

                JavaFieldDeclaration fieldDec;
                JavaField field;
                String fieldName = CALToJavaNames.fixupVarName(mf.getParameterNames()[i]);
                fieldDec = new JavaFieldDeclaration (Modifier.PRIVATE, JavaTypeNames.RTVALUE, fieldName, null);
                field = new JavaField.Instance (null, fieldName, JavaTypeNames.RTVALUE);
                lazyAppClassRep.addFieldDeclaration(fieldDec);
                functionArgumentMemberFields[i] = field;
            }

            // Add the constructor.
            lazyAppClassRep.addConstructor(createLazyAppClass_constructor(mf, functionField, functionArgumentMemberFields));
View Full Code Here

            JavaTypeName.BOOLEAN,
            "isCompatibleWithCurrentConfiguration",
            new JavaExpression.MethodInvocation.Static(
                libClassName, checkConfigMethod.getMethodName(), new JavaExpression[0], new JavaTypeName[0], JavaTypeName.BOOLEAN));
       
        classRep.addFieldDeclaration(isCompatibleWithCurrentConfigurationField);
       
        // We are finished with building the class.
        return classRep;
    }
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.