Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.TypeConsApp


    }
   
    @Override
    public int getNElements() {
       
        TypeConsApp listTypeConsApp = ((TypeConsApp) getListValueNode().getTypeExpr());
      
        if (!consolidatedColumns && isListRecord()) {
            // Special case: in the case of a list of record, index the record fields
            return listTypeConsApp.getArg(0).rootRecordType().getNHasFields();
           
        } else {
            return listTypeConsApp.getNArgs();
       
    }
View Full Code Here


     * Note that this will also be true if the type of the data is a List of Tuples.
     * @return boolean
     */
    public boolean isListRecord() {
        // Note: Always assume that typeExpr is a List.
        TypeConsApp listTypeConsApp = (TypeConsApp) getListValueNode().getTypeExpr();                
        return listTypeConsApp.getArg(0).rootRecordType() != null;
    }
View Full Code Here

            TypeColour newTC = new TypeColour(type, getNextColour());
            colourMap.put(type.toString(), newTC);       
        }
            
        //add argument types of type constructors
        TypeConsApp typeConsApp = type.rootTypeConsApp();       
        if (typeConsApp != null) {                                 
            for (int i = 0, nArgs = typeConsApp.getNArgs(); i < nArgs; ++i) {
                addType(typeConsApp.getArg(i));  
            }          
        }
       
    }
View Full Code Here

               
                // If we got a null result and no error, check for the case where the null represents a null foreign value.
               
                // foreignTypeConsApp will hold the TypeConsApp for the output value
                // if the value is a foreign value and the result is null.
                TypeConsApp foreignTypeConsApp = null;
                if (errorMessage == null && vn != null) {
                    TypeConsApp typeConsApp = vn.getTypeExpr().rootTypeConsApp();
                    if (typeConsApp != null && typeConsApp.getForeignTypeInfo() != null) {
                        foreignTypeConsApp = typeConsApp;
                    }
                }

                if (foreignTypeConsApp != null) {
View Full Code Here

         * @param providerSupportInfo
         * @return true if the type of the list elements is supported
         */
        private boolean canEditListType(ListValueNode valueNode, SupportInfo providerSupportInfo) {

            TypeConsApp listTypeConsApp = valueNode.getTypeExpr().rootTypeConsApp();
            TypeExpr typeConsArg = listTypeConsApp.getArg(0);
           
            return getValueEditorManager().canEditInputType(typeConsArg, providerSupportInfo);
        }
View Full Code Here

       
        final List<ClassTypeInfo> dataTypes = new ArrayList<ClassTypeInfo>();
        for (final TypeExpr typePiece : functionalAgentType.getTypePieces()) {
           
            if (typePiece instanceof TypeConsApp) {
                final TypeConsApp typeConsApp = (TypeConsApp)typePiece;
                final ForeignTypeInfo foreignTypeInfo = typeConsApp.getForeignTypeInfo();
               
                if (foreignTypeInfo != null && isScopeVisibleAsJavaLibraryAPI(foreignTypeInfo.getImplementationVisibility())) {
                    // we use the implementation type if the type is foreign and the implementation is visible
                    dataTypes.add(ClassTypeInfo.make(foreignTypeInfo.getForeignType()));
                   
                } else if (typeConsApp.isNonParametricType(CAL_Prelude.TypeConstructors.Boolean)) {
                    // Special handling required for Prelude.Boolean - it an algebraic type that has a custom RTData representation
                    dataTypes.add(ClassTypeInfo.make(boolean.class));
                   
                } else {
                    dataTypes.add(ClassTypeInfo.makeNonForeign());
View Full Code Here

TOP

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

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.