Esempio n. 1
0
 /// <returns>Hashtable&lt;Namespace,ArrayList&lt;TerminalName&gt;&gt;</returns>
 private static ReadOnlyDictionary CreateNamespaceToVariablesAllocatedTherein(IEnumerable liveLocalNonParameterVariableNames)
 {
     var result=new Hashtable();
       foreach(TerminalName name in liveLocalNonParameterVariableNames) {
     result.LookupOrCreateArrayList(name.Namespace).Add(name);
       }
       return result.AsReadOnlyDictionary();
 }
Esempio n. 2
0
 /// <summary>
 /// Basically: liveVariables.Select(lv=>lv.Namespace).GroupBy(ns=>ns.Depth)
 /// </summary>
 /// <returns>Hashtable&lt;int,ArrayList&lt;Namespace&gt;&gt;</returns>
 private static ReadOnlyDictionary MakeDepthToNamespaces(IEnumerable liveLocalNonParameterVariableNames, out int maxDepth)
 {
     var result=new Hashtable();
       var beenHere=new Hashtable();
       maxDepth=-1;
       foreach(TerminalName name in liveLocalNonParameterVariableNames) {
     var ns=name.Namespace;
     maxDepth=Math.Max(maxDepth, ns.Depth);
     while(ns!=null) {
       if(beenHere.Contains(ns)) {
     break;
       }
       beenHere.Add(ns, null);
       result.LookupOrCreateArrayList(ns.Depth).Add(ns);
       ns=ns.Inner;
     }
       }
       return result.AsReadOnlyDictionary();
 }