Package org.openquark.cal.internal.javamodel

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


                    // ordinal and returns the corresponding enum instance.
                    javaClassRep.addMethod(createMethod_fromOrdinal (typeConstructorClassName));
                }
               
                if (typeConstructorInfo.commonFieldNames.size() > 0) {
                    javaClassRep.addConstructor(createConstructor(typeConstructorInfo, typeConstructorClassName));
                } else {
                    javaClassRep.addConstructor(createConstructor_default(typeConstructorClassName, typeConstructorInfo.isEnumerationType));
                   
                }
               
View Full Code Here


                }
               
                if (typeConstructorInfo.commonFieldNames.size() > 0) {
                    javaClassRep.addConstructor(createConstructor(typeConstructorInfo, typeConstructorClassName));
                } else {
                    javaClassRep.addConstructor(createConstructor_default(typeConstructorClassName, typeConstructorInfo.isEnumerationType));
                   
                }
               
                // Create a get_FieldName method for each unique field name in the set of
                // data constructors. 
View Full Code Here

                    new JavaDocComment ("This class represents instances of the CAL data constructor " + dc.getName() + ".");
                dcClass.setJavaDoc(jdc);
               
                createFields (dcClass, dc, typeConstructorInfo);
               
                dcClass.addConstructor(createConstructor(dc, typeConstructorInfo, dcClassTypeName));
               
                dcClass.addMethod(createMethod_getDCName(dc.getName().getUnqualifiedName()));
   
                for (FieldName fieldName : dcInfo.fieldTypeNames.keySet()) {
                    if (typeConstructorInfo.commonFieldNames.contains(fieldName)) {
View Full Code Here

            JavaTypeName fieldSelectionTypeName = CALToJavaNames.createFieldSelectionClassTypeNameFromDC(dc, module);
            // Now instantiate the java class representation.
            JavaClassRep fieldSelectionClass = new JavaClassRep(fieldSelectionTypeName, JavaTypeNames.RTDATACONS_FIELD_SELECTION, classModifiers, interfaces);

            // Add the constructor: FieldSelection (RTValue $dataConsExpr, int $fieldOrdinal, ErrorInfo $errorInfo);
            fieldSelectionClass.addConstructor(createDCFieldSelectionClass_constructor ());

            // Add the method: private final String getFieldNameByOrdinal (int ordinal);
            fieldSelectionClass.addMethod(createDCFieldSelectionClass_method_getFieldNameByOrdinal());

            fieldSelectionClass.addMethod (createDCFieldSelectionClass_method_getDCName());
View Full Code Here

            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);
            javaConstructor.addStatement(new ExpressionStatement(tagAssign));


View Full Code Here

                strictAppClassRep.addFieldDeclaration(fieldDec);
                functionArgumentMemberFields[i] = field;
            }

            // Add the constructor
            strictAppClassRep.addConstructor(createStrictAppClass_constructor(mf, functionField, functionArgumentMemberFields));

            // Add the reduce method.
            strictAppClassRep.addMethod(createStrictAppClass_method_reduce(mf, functionField, strictAppTypeName, functionArgumentMemberFields));

            // Add the clearMembers() method.
View Full Code Here

                lazyAppClassRep.addFieldDeclaration(fieldDec);
                functionArgumentMemberFields[i] = field;
            }

            // Add the constructor.
            lazyAppClassRep.addConstructor(createLazyAppClass_constructor(mf, functionField, functionArgumentMemberFields));

            // Add the reduce method.
            lazyAppClassRep.addMethod(createLazyAppClass_method_reduce(mf, functionField, lazyAppTypeName, functionArgumentMemberFields));

            // Add the clearMembers() method.
View Full Code Here

        // Code fragment:
        //
        // private {MainClassConstructorName} {}
        //
       
        classRep.addConstructor(makePrivateConstructor(mainClassName));
       
        // Code fragment:
        //
        // public static void main(final String[] args) throws CALExecutorException
        //
View Full Code Here

        // Code fragment:
        //
        // private {LibClassConstructorName} {}
        //
       
        classRep.addConstructor(makePrivateConstructor(libClassName));

        // We sort the functional agents, because the order returned by the ModuleTypeInfo is neither source order nor alphabetical order
        // Case-sensitive ordering would order data constructors ahead of functions
        final FunctionalAgent[] functionalAgents = moduleTypeInfo.getFunctionalAgents();
        Arrays.sort(functionalAgents, new Comparator<FunctionalAgent>() {
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.