/** * Attaches vertex representing type specification to vertex representing it's type definition. * Creates structure: Type --- [IsTypeDefinitionOf] ---> QualifiedType and sets edge's attributes. * * @param typeVertex A vertex representing a type definition. * @param qualifiedTypeVertex A vertex representing a type specification. */ private void attach(QualifiedType qualifiedTypeVertex, Type typeVertex) { /* IsTypeDefinitionOf isTypeDefinitionOfEdge = */ symbolTable .getGraph() .createIsTypeDefinitionOf(typeVertex, qualifiedTypeVertex); qualifiedTypeVertex.set_fullyQualifiedName(typeVertex.get_fullyQualifiedName()); /* IsExternalDeclarationIn isExternalDeclarationInEdge = */ typeVertex .getFirstIsExternalDeclarationInIncidence(); }
/** * Attaches vertex representing type specification to vertex representing it's type definition. * Determines if type specification was resolved before. * * @param qualifiedTypeVertex A vertex representing a type specification. * @param typeVertex A vertex representing a type definition. */ protected void attachToType(QualifiedType qualifiedTypeVertex, Type typeVertex) { String fullyQualifiedName = typeVertex.get_fullyQualifiedName(); if (symbolTable.hasResolvedTypeSpecification(fullyQualifiedName)) { replaceByResolvedOne(fullyQualifiedName, qualifiedTypeVertex); } else { attach(qualifiedTypeVertex, typeVertex); symbolTable.addResolvedTypeSpecification(qualifiedTypeVertex); } }