/// <summary> /// Return all nodes with references to types that occur within a given type declaration. /// </summary> /// <returns>References of types within a given type declaration.</returns> public DirectTypeRef[] GetReferences() { var couplings = new DirectTypeRef[currentReferences.Count]; // Copy result to an array to make it immutable currentReferences.Values.CopyTo(couplings, 0); return(couplings); }
/// <summary> /// Add found reference to a type used within the currently traversed type declaration. /// </summary> /// <param name="x">Reference to class or interface.</param> public void AddCoupling(DirectTypeRef x) { Debug.Assert(isInsideDeclaration); // Presence of itself is not taken into account // Class names are case-insensitive if (!x.ClassName.Equals(currentType.QualifiedName)) { currentReferences[x.ClassName] = x; } }
/// <inheritdoc /> public override void VisitDirectTypeRef(DirectTypeRef x) { AddCoupling(x); base.VisitDirectTypeRef(x); }
private VariableUse CreateStaticFieldUse(Position position, GenericQualifiedName /*!*/ className, Position classNamePosition, CompoundVarUse /*!*/ field) { return(CreateStaticFieldUse(position, DirectTypeRef.FromGenericQualifiedName(classNamePosition, className), field)); }
public CatchBlock(DirectTypeRef typeRef, BoundVariableRef variable) { _typeRef = typeRef; _variable = variable; }
/// <summary> /// Whether the given class name is equal to <c>Exception</c>. /// </summary> private static bool IsExceptionClassName(DirectTypeRef tref) { return (tref.GenericParams.Count == 0 && tref.ClassName == NameUtils.SpecialNames.Exception); }