예제 #1
0
	def decomposeData(self):
		# TODO: invEntityLoc - use declLocation or defLocation
		self.sourceFile = self.cols[self.sourceLocationColumnIndex]
		self.start = self.cols[self.sourceLocationColumnIndex+1].split(".")[0]
		self.end = self.start
		srcLoc = SourceLocation(self.sourceFile, self.start, self.end)
		if self.isAnImplementation():
			self.addDefinition(srcLoc)
		else:
			self.addDeclaration(srcLoc)
	
		i=self.sourceLocationColumnIndex+3
		declaredType, self.parameters = retrieveSignature(self.cols[i:])
		# deal with inlined method declarations
		declaredType = declaredType.replace("inline ", "")
		typeRef = self.getTypeReference()
		typeRef.setReferencedName(declaredType)
		self.preprocessParameters()
예제 #2
0
    def decomposeData(self):
        # TODO: invEntityLoc - use declLocation or defLocation
        self.sourceFile = self.cols[self.sourceLocationColumnIndex]
        self.start = self.cols[self.sourceLocationColumnIndex +
                               1].split(".")[0]
        self.end = self.start
        srcLoc = SourceLocation(self.sourceFile, self.start, self.end)
        if self.isAnImplementation():
            self.addDefinition(srcLoc)
        else:
            self.addDeclaration(srcLoc)

        i = self.sourceLocationColumnIndex + 3
        declaredType, self.parameters = retrieveSignature(self.cols[i:])
        # deal with inlined method declarations
        declaredType = declaredType.replace("inline ", "")
        typeRef = self.getTypeReference()
        typeRef.setReferencedName(declaredType)
        self.preprocessParameters()
예제 #3
0
def parseFormalParameters(miDb):
    input_file=open(miDb, 'r')
    for line in input_file:
        line = line.strip()
        cols = line.split(";")
        par_types, par_names = utils.retrieveFormalParameters(cols[6:])
        signature = utils.retrieveSignature(cols[6:])
        behEntName = ""

        # remove template parameters from method or function name
        if ( cols[1].startswith("<") and (">" in cols[1]) ):
            # cut of the part until and including the first > character
            cols[1]=cols[1][cols[1].index(">")+1:]

        if cols[0] != "#":
            behEntName = cols[0] + "." + cols[1] + signature[1]
        else : behEntName = cols[1] + signature[2]

        i = 0
        while i < len(par_names):
            common.famix.cdifWriter.generateFormalParInfo(par_names[i], par_types[i], behEntName, i+1)
            i = i + 1

    input_file.close()