Exemplo n.º 1
0
	def resolveParentType(self,classDict):
		parentType = TypeReference()
		parentType.resolvedName = self.owner
		parentType.referencedName = \
						utils.composeQualifiedName(self.package,self.owner)
		self.parentType = parentType

		# TODO package!
		className = utils.spliceClass(	self.parentType.referencedName, \
										utils.qualSeparator)
		srcLocs = classDict.getSourceLocations(className)
		if 1 == len(srcLocs):
			dstLoc = srcLocs[0][0]
			dstLineNr = srcLocs[0][1]
			self.parentType.sourceFile = dstLoc
			self.parentType.lineNr = dstLineNr
			#pkgName = pkgDict.getPackageForFile(dstLoc)
			#attrType.resolvedName = \
			#		utils.composeQualifiedName(pkgName,attrType.resolvedName)
			#attrType.sourceFile = dstLoc
			#attrType.lineNr = dstLineNr
		elif 0 == len(srcLocs):
			self.log.warn(	"no source locations for attribute owner: "+\
							self.parentType.referencedName+" of attribute "+\
							self.owner+"."+self.name)
			self.parentType.sourceFile = ""
			self.parentType.lineNr = "0"
		else:
			self.log.warn(	"multiple source locations for attribute owner: "+\
							self.parentType.referencedName+" of attribute "+\
							self.owner+"."+self.name)
			self.parentType.sourceFile = ""
			self.parentType.lineNr = "0"
Exemplo n.º 2
0
    def resolveParentType(self, classDict):
        parentType = TypeReference()
        parentType.resolvedName = self.owner
        parentType.referencedName = \
            utils.composeQualifiedName(self.package,self.owner)
        self.parentType = parentType

        # TODO package!
        className = utils.spliceClass( self.parentType.referencedName, \
                utils.qualSeparator)
        srcLocs = classDict.getSourceLocations(className)
        if 1 == len(srcLocs):
            dstLoc = srcLocs[0][0]
            dstLineNr = srcLocs[0][1]
            self.parentType.sourceFile = dstLoc
            self.parentType.lineNr = dstLineNr
            #pkgName = pkgDict.getPackageForFile(dstLoc)
            #attrType.resolvedName = \
            #		utils.composeQualifiedName(pkgName,attrType.resolvedName)
            #attrType.sourceFile = dstLoc
            #attrType.lineNr = dstLineNr
        elif 0 == len(srcLocs):
            self.log.warn( "no source locations for attribute owner: "+\
                self.parentType.referencedName+" of attribute "+\
                self.owner+"."+self.name)
            self.parentType.sourceFile = ""
            self.parentType.lineNr = "0"
        else:
            self.log.warn( "multiple source locations for attribute owner: "+\
                self.parentType.referencedName+" of attribute "+\
                self.owner+"."+self.name)
            self.parentType.sourceFile = ""
            self.parentType.lineNr = "0"
Exemplo n.º 3
0
	def resolveAttrType(self, pkgDict, classDict, attrTypeDict):
		""" resolves attribute type information such as
			qualified name and source location """
		attrType = TypeReference()

		qualAttrName = self.getQualAttrName()
		if attrTypeDict.has_key(qualAttrName):
			attrType.referencedName = attrTypeDict[qualAttrName]
		else:
			attrType.referencedName = ""
		attrType.resolvedName = typeToClass(attrType.referencedName)
		self.__locateAttributeType(pkgDict, classDict, attrType)
Exemplo n.º 4
0
    def resolveAttrType(self, pkgDict, classDict, attrTypeDict):
        """ resolves attribute type information such as
			qualified name and source location """
        attrType = TypeReference()

        qualAttrName = self.getQualAttrName()
        if attrTypeDict.has_key(qualAttrName):
            attrType.referencedName = attrTypeDict[qualAttrName]
        else:
            attrType.referencedName = ""
        attrType.resolvedName = typeToClass(attrType.referencedName)
        self.__locateAttributeType(pkgDict, classDict, attrType)
Exemplo n.º 5
0
    def resolveParentType(self, classDict):
        parentType = TypeReference()
        parentType.resolvedName = self.owner

        if "" == self.package:
            parentType.referencedName = self.owner
        else:
            parentType.referencedName = self.package + "::" + self.owner
        srcLocs = classDict.getSourceLocations(self.owner)
        if 1 == len(srcLocs):
            parentType.sourceFile = srcLocs[0][0]
            parentType.lineNr = srcLocs[0][1]
        else:
            self.log.warn("multiple source locations for class",\
              parentType.sourceFile)
        self.parentType = parentType
Exemplo n.º 6
0
	def resolveParentType(self,classDict):
		parentType = TypeReference()
		parentType.resolvedName = self.owner

		if "" == self.package:
			parentType.referencedName = self.owner
		else:
			parentType.referencedName = self.package+"::"+self.owner
		srcLocs = classDict.getSourceLocations(self.owner)
		if 1 == len(srcLocs):
			parentType.sourceFile = srcLocs[0][0]
			parentType.lineNr = srcLocs[0][1]
		else:
			self.log.warn("multiple source locations for class",\
					parentType.sourceFile)
		self.parentType = parentType
Exemplo n.º 7
0
 def resolveReturnType(self):
     self.retType = TypeReference()
     self.retType.resolvedName = utils.cleanCol(self.cols[6])
     self.retType.referencedName = self.retType.resolvedName
Exemplo n.º 8
0
 def __init__(self):
     NamespaceElementEntityReference.__init__(self)
     self.typeReference = TypeReference()
Exemplo n.º 9
0
	def __init__(self):
		self.parentReference = TypeReference()
Exemplo n.º 10
0
	def __init__(self, typedEntityLine):
		Entity.__init__(self, typedEntityLine)
		self.sourceFile = ""
		self.start = ""
		self.typeReference = TypeReference()