Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.FieldName


            applicationExpressions[0] = SourceModel.Expr.Var.makeUnqualified(calConstructorName);

            Expr.Var unsafeCoerce = Expr.Var.make(CAL_Prelude.Functions.unsafeCoerce);
           
            for (int i = 0, n = dc.getArity(); i < n; ++i) {
                FieldName fn = dc.getNthFieldName(i);
               
                SourceModel.Expr argValue = Expr.SelectDataConsField.make(dcVar, dataConsSourceModelName, SourceModel.Name.Field.make(fn));
               
                // If the type of the dc field matches the type of the constructor argument
                // we can simply use the field accessor.  Otherwise we need to apply output to
View Full Code Here


                argCastToInnerJType = Expr.Var.makeUnqualified(letVarName);
            }
           
           
            for (int i = 0, n = dc.getArity(); i < n; ++i) {
                FieldName fn = dc.getNthFieldName(i);
                JavaTypeName fieldType = (JavaTypeName)dcInfo.fieldTypeNames.get(fn);
                String fieldAccessorName = typeConstructorInfo.calFieldAccessorFunctionNames.get(fn).get(dc);
               
                // If the type of the retrieved field matches the type of the dc field
                // we can simply use the field accessor.  Otherwise we need to apply input to
View Full Code Here

                    !thisGem.isConnected() &&
                    typeToUnify.getArity() > 0) {
                //special case for burning a record field selection gem input pieces
                //we must consider changing the selected field.
                TypeExpr[] typePieces = typeToUnify.getTypePieces(1);
                FieldName fieldName = RecordFieldSelectionGem.pickFieldName(typePieces[0], typePieces[1], currentModuleTypeInfo);

                if (fieldName != null) {
                    //there is a valid field that can be picked if the input is burnt
                    autoBurnLastResult = AutoburnLogic.AutoburnAction.BURNED;
                    gemChanged = true;
View Full Code Here

        return containsKey(FieldName.makeOrdinalField(ordinalFieldName));
    }

    /** {@inheritDoc}*/
    public Object getTextualField(String textualFieldName) {
        FieldName fieldName = FieldName.make(textualFieldName);
        if (fieldName instanceof FieldName.Ordinal) {
            throw new ClassCastException();
        }
        return get(fieldName);
    }
View Full Code Here

        return get(fieldName);
    }
   
    /** {@inheritDoc}*/
    public boolean hasTextualField(String textualFieldName) {
        FieldName fieldName = FieldName.make(textualFieldName);
        if (fieldName instanceof FieldName.Ordinal) {
            throw new ClassCastException();
        }       
        return containsKey(fieldName);
    }
View Full Code Here

        for (int i = 0, numInputs = getNInputs(); i < numInputs; i++) {
            PartInput inputPart = getInputPart(i);
           
            String nameFromEntity = i < numNamedArgs ? gemEntity.getNamedArgument(i) : null;
            String displayName = i < argMetadata.length ? argMetadata[i].getDisplayName() : null;
            FieldName caldocName = (caldoc != null && i < caldoc.getNArgBlocks()) ? caldoc.getNthArgBlock(i).getArgName() : null;
           
            String originalName;
            if (displayName != null) {
                originalName = displayName;
            } else if (caldocName != null && caldocName instanceof FieldName.Textual) {
                // if the CALDoc name is present, we will use it instead of the name from the entity
                // since the CALDoc name is specified by the user, where the name from the entity
                // may have come from an automatically extracted parameter name for a foreign function
                originalName = caldocName.getCalSourceForm();
            } else if (nameFromEntity != null) {
                originalName = nameFromEntity;
            } else {
                originalName = null;
            }
View Full Code Here

     */
    Connection handleConnectGemPartsGesture(PartConnectable srcPart, PartInput destPart) {

        Connection newConnection = null;       
        boolean canConnect = false;
        FieldName fieldName;
       
        undoableEditSupport.beginUpdate();
       
        //this is a record field selection gem for which the field has been updated by the connection
        RecordFieldSelectionGem modifiedRecordFieldSelectionGem=null;
View Full Code Here

            equals.addStatement(ifThen);
           
            if (fieldNames != null && fieldNames.size() > 0) {
                // Now we need to compare equality for the various fields.
                Iterator<FieldName> fields = fieldNames.iterator();
                FieldName fn = fields.next ();
                JavaTypeName fieldType = (JavaTypeName)fieldNameToType.get(fn);
                JavaExpression compare = makeFieldComparison (fn, fieldType, localVar);
               
                while (fields.hasNext()) {
                    fn = fields.next ();
View Full Code Here

            }
           
            for (int i = 0, n = typeConstructor.getNDataConstructors(); i < n; ++i) {
                DataConstructor dc = typeConstructor.getNthDataConstructor(i);
                for (int j = 0, k = dc.getArity(); j < k; ++j) {
                    FieldName fn = dc.getNthFieldName(j);

                    Map<DataConstructor, String> calAccessorNames = calFieldAccessorFunctionNames.get(fn);
                    if (calAccessorNames == null) {
                        calAccessorNames = new LinkedHashMap<DataConstructor, String>();
                        calFieldAccessorFunctionNames.put(fn, calAccessorNames);
View Full Code Here

                String[] argNames = new String [dc.getArity()];
                JavaTypeName[] argTypes = new JavaTypeName [argNames.length];
                Block constructorBody = new Block();
               
                for (int i = 0, n = dc.getArity(); i < n; ++i) {
                    FieldName fn = (FieldName)dc.getNthFieldName(i);
                   
                    JavaTypeName type = (JavaTypeName)dci.fieldTypeNames.get(fn);
                    String fieldName = (String)typeConstructorInfo.fieldJavaNames.get(fn);
                    String argName = fieldName+"$";
       
View Full Code Here

TOP

Related Classes of org.openquark.cal.compiler.FieldName

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.