private SymbolInfo FindAllInAreaList(SymbolInfo si,string name,Scope[] arr,AreaNodesList AreaNodes, bool StopIfFind, SymbolInfo FirstInfo) { if (arr==null) return si; int p; SymbolInfo sib=si; HashSet<Assembly> assm_cache = new HashSet<Assembly>(); foreach(Scope sc in arr) { if (sc is DotNETScope) { if (sc is PascalABCCompiler.NetHelper.NetScope) { PascalABCCompiler.NetHelper.NetScope netScope = sc as PascalABCCompiler.NetHelper.NetScope; if (PascalABCCompiler.NetHelper.NetHelper.PABCSystemType == null || netScope.Assembly != PascalABCCompiler.NetHelper.NetHelper.PABCSystemType.Assembly) { if (!assm_cache.Contains(netScope.Assembly)) assm_cache.Add(netScope.Assembly); else if (netScope.used_namespaces.Count == 0) continue; } } si = AddToSymbolInfo(si, (DotNETScope)sc, name); if (sib.Next != null && StopIfFind) return si; } else if (AreaNodes != null && sc != null) { p = AreaNodes.IndexOf(sc.ScopeNum); if (p >= 0) { si = AddToSymbolInfo(si, AreaNodes[p].InfoList, sc, FirstInfo); if (sib.Next != null && StopIfFind) return si; } } } return si; }
private SymbolInfo FindAllInClass(SymbolInfo si, string name, int ClassArea, AreaNodesList AreaList, bool OnlyInThisClass, SymbolInfo FirstInfo) { int ai; Scope ar = ScopeTable[ClassArea]; if ((ai = AreaList.IndexOf(ClassArea)) >= 0) si = AddToSymbolInfo(si, AreaList[ai].InfoList, ar, FirstInfo); if (ar is DotNETScope) { PascalABCCompiler.TreeRealization.BasePCUReader.RestoreSymbols(si, name); return AddToSymbolInfo(si, (DotNETScope)ar, name); } ClassScope cl = (ClassScope)ScopeTable[ClassArea]; if(!OnlyInThisClass) while (cl.BaseClassScopeNum >= 0) { ai = AreaList.IndexOf(cl.BaseClassScopeNum); if (ai >= 0) si = AddToSymbolInfo(si, AreaList[ai].InfoList, cl.BaseClassScope, FirstInfo); //cl=(ClassScope)ScopeTable[cl.BaseClassScopeNum]; ar = ScopeTable[cl.BaseClassScopeNum]; if (ar is DotNETScope) return AddToSymbolInfo(si, (DotNETScope)ar, name); cl = (ClassScope)ScopeTable[cl.BaseClassScopeNum]; } return si; }