Package org.openquark.cal.compiler.SourceModel

Examples of org.openquark.cal.compiler.SourceModel.FunctionTypeDeclaration


                SourceModel.FunctionDefn functionDefn = (FunctionDefn) element;
                String name = functionDefn.getName();
                for (int i = 0; i < nTopLevelDefns; i++) {
                    TopLevelSourceElement nthTopLevelDefn = moduleDefn.getNthTopLevelDefn(i);
                    if (nthTopLevelDefn instanceof FunctionTypeDeclaration){
                        FunctionTypeDeclaration type = (FunctionTypeDeclaration) nthTopLevelDefn;
                        if (type.getFunctionName().equals(name)){
                            element = type;
                            break;
                        }
                    }
                }
View Full Code Here


        if (logger.getNErrors() == 0){
            final int nDefs = sourceModel.getNTopLevelDefns();
            for(int iType = 0; iType < nDefs; ++iType){
                final TopLevelSourceElement element = sourceModel.getNthTopLevelDefn(iType);
                if (element instanceof FunctionTypeDeclaration){
                    FunctionTypeDeclaration typeDeclaration = (FunctionTypeDeclaration) element;
                    if (typeDeclaration.getFunctionName().equals(functionName.getUnqualifiedName())){
                        SourceRange sourceRangeOfType = typeDeclaration.getSourceRangeOfDefn();
                        return new Precise(sourceRangeOfType, functionName, null, false);
                    }
                }
            }
        }
View Full Code Here

            Set<ModuleName> importsThatProduceConflicts = new HashSet<ModuleName>();
            boolean noConflicts = updateWithUnimportedModules(unimportedModules, importsThatProduceConflicts, moduleTypeInfo, typeExpr);

            if (noConflicts) {
                TypeSignature typeSignature = typeExpr.toSourceModel(null, namingPolicy);
                FunctionTypeDeclaration typeDecl = FunctionTypeDeclaration.make(function.getName(), typeSignature);

                SourcePosition insertionPosition = function.getSourceRangeExcludingCaldoc().getStartSourcePosition();

                String insertionText = makeIndentedSourceElementText(typeDecl, insertionPosition, sourceText, false);
                sourceModifier.addSourceModification(new SourceModification.InsertText(insertionText, insertionPosition));
View Full Code Here

TOP

Related Classes of org.openquark.cal.compiler.SourceModel.FunctionTypeDeclaration

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.