Example #1
0
		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();
		}
Example #2
0
        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());
        }
Example #3
0
		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);
			}
		}
Example #4
0
 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);
         }
     }
 }