public static IList<Subprogram> GetCallsRec(Subprogram sp) { List<Subprogram> splist = new List<Subprogram>(); foreach (Subprogram callee in sp.GetCalls()) Enumerate(callee, (x => { }), splist); return splist.AsReadOnly(); }
public static IList <Subprogram> GetCallsRec(Subprogram sp) { List <Subprogram> splist = new List <Subprogram>(); foreach (Subprogram callee in sp.GetCalls()) { Enumerate(callee, (x => { }), splist); } return(splist.AsReadOnly()); }
private static void Enumerate(Subprogram sp, Action<Subprogram> handler, IList<Subprogram> visited) { if (!visited.Contains(sp)) { handler(sp); visited.Add(sp); foreach (Subprogram callee in sp.GetCalls()) Enumerate(callee, handler, visited); } }
private static void Enumerate(Subprogram sp, Action <Subprogram> handler, IList <Subprogram> visited) { if (!visited.Contains(sp)) { handler(sp); visited.Add(sp); foreach (Subprogram callee in sp.GetCalls()) { Enumerate(callee, handler, visited); } } }