public override void Visit(INamespaceMember namespaceMember) { if (Process(namespaceMember)) { visitor.Visit(namespaceMember); } base.Visit(namespaceMember); }
public bool FilterNamespace(INamespaceMember member) { ITypeDefinition type = member as ITypeDefinition; if (type != null) return FilterType(type); // Lets not filter anything else here yet. return false; }
//^ [Pure] /// <summary> /// Return true if the given member instance is a member of this scope. /// </summary> /// <param name="member"></param> /// <returns></returns> public bool Contains(INamespaceMember member) { foreach (INamespaceMember nsmem in this.Members) { if (member == nsmem) { return(true); } } return(false); }
public bool FilterNamespace(INamespaceMember member) { ITypeDefinition type = member as ITypeDefinition; if (type != null) { return(FilterType(type)); } // Lets not filter anything else here yet. return(false); }
public override List <INamespaceMember> Rewrite(List <INamespaceMember> namespaceMembers) { List <INamespaceMember> newList = new List <INamespaceMember>(); if (namespaceMembers == null) { return(newList); } foreach (INamespaceMember member in namespaceMembers) { Element currentElement = null; MemberTypes memberType = Util.GetMemberTypeFromMember(member); if (memberType == MemberTypes.Type) { INamedTypeDefinition typeDef = member as INamedTypeDefinition; string typeName = Util.FullyQualifiedTypeNameFromType(typeDef); currentElement = _currentTrimAssembly.GetTypeElement(typeName); // special case for the module class. In mscorlib we don't have any global functions, etc. // TODO: process its members too. if (currentElement == null && IsSpecialType(typeName)) { currentElement = new SpecialTrimType(typeName); if (!_systemTypes.Contains(typeName)) { _systemTypes.Add(typeName); } } } else { currentElement = new SpecialTrimMember(null, member.Name.Value, null, memberType); } if (currentElement != null) { _trimElements.Push(currentElement); // Visit(INamespaceMember) will create the Mutable copy INamespaceMember newMember = this.Rewrite(member); newList.Add(newMember); _trimElements.Pop(); } } return(newList); }
public virtual void VisitNamespace(UnitNamespace unitNamespace) { if (unitNamespace.Members == null) { return; } for (int i = 0; i < unitNamespace.Members.Count; i++) { INamespaceMember member = unitNamespace.Members[i]; MethodDefinition methodDef = member as MethodDefinition; if (methodDef != null) { VisitMethod(methodDef, null); continue; } NamespaceTypeDefinition typeDef = member as NamespaceTypeDefinition; if (typeDef != null) { VisitType(typeDef); continue; } UnitNamespace ns = member as UnitNamespace; if (ns != null) { VisitNamespace(ns); } else { throw new InvalidOperationException("INamespaceMember"); } } }
public bool Contains(INamespaceMember member) { throw new NotImplementedException(); }
/// <summary> /// Visits the specified namespace member. /// </summary> public void Visit(INamespaceMember namespaceMember) { }
/// <summary> /// Visits the specified namespace member. /// </summary> /// <param name="namespaceMember">The namespace member.</param> public virtual void Visit(INamespaceMember namespaceMember) { if (this.stopTraversal) return; INamespaceDefinition/*?*/ nestedNamespace = namespaceMember as INamespaceDefinition; if (nestedNamespace != null) this.Visit(nestedNamespace); else { ITypeDefinition/*?*/ namespaceType = namespaceMember as ITypeDefinition; if (namespaceType != null) this.Visit(namespaceType); else { ITypeDefinitionMember/*?*/ globalFieldOrMethod = namespaceMember as ITypeDefinitionMember; if (globalFieldOrMethod != null) this.Visit(globalFieldOrMethod); else { INamespaceAliasForType/*?*/ namespaceAlias = namespaceMember as INamespaceAliasForType; if (namespaceAlias != null) this.Visit(namespaceAlias); else { //TODO: error namespaceMember.Dispatch(this); } } } } }
/// <summary> /// Visits the specified namespace member. /// </summary> public virtual void Visit(INamespaceMember namespaceMember) { }
/// <summary> /// Traverses the namespace member. /// </summary> public void Traverse(INamespaceMember namespaceMember) { Contract.Requires(namespaceMember != null); namespaceMember.Dispatch(this.dispatchingVisitor); }
/// <summary> /// Visits the specified namespace member. /// </summary> public virtual void Visit(INamespaceMember namespaceMember) { //INamespaceMember is a base interface that should never be implemented directly. //Get namespaceMember to call the most type specific visitor. namespaceMember.Dispatch(this); }
public bool Contains(INamespaceMember member) { return(this.Members.Contains(member)); }
public override void Visit(INamespaceMember namespaceMember) { if(Process(namespaceMember)){visitor.Visit(namespaceMember);} base.Visit(namespaceMember); }
public bool Contains(INamespaceMember member) { return this.Members.Contains(member); }
public bool Contains(INamespaceMember member) { return false; }
/// <summary> /// Visits the specified namespace member. /// </summary> public virtual void Visit(INamespaceMember namespaceMember) { }
/// <summary> /// Rewrites the specified namespace member. /// </summary> public virtual INamespaceMember Rewrite(INamespaceMember namespaceMember) { return namespaceMember; }
public override void Visit(INamespaceMember namespaceMember) { allElements.Add(new InvokInfo(Traverser, "INamespaceMember", namespaceMember)); }
/// <summary> /// Visits the specified namespace member. /// </summary> public void Visit(INamespaceMember namespaceMember) { if (this.definitionsAlreadyVisited.Contains(namespaceMember)) { this.ReportError(MetadataError.DuplicateDefinition, namespaceMember); return; } this.definitionsAlreadyVisited.Add(namespaceMember); if (namespaceMember.Name.Value == string.Empty) this.ReportError(MetadataError.EmptyName, namespaceMember); if (namespaceMember.ContainingNamespace is Dummy) this.ReportError(MetadataError.IncompleteNode, namespaceMember, "ContainingNamespace"); if (!this.definitionsAlreadyVisited.Contains(namespaceMember.ContainingNamespace) && !(namespaceMember is ITypeDefinitionMember)) this.ReportError(MetadataError.ContainingNamespaceDefinitionNotVisited, namespaceMember); }
/// <summary> /// Traverses the namespace member. /// </summary> public void Traverse(INamespaceMember namespaceMember) { namespaceMember.Dispatch(this.dispatchingVisitor); }