Do you want to do this at run time, or just find the pieces of code referenced in a particular program as part of a development excercise?
If you want to do it at development time, then you can use Notepad++ or Textpad to do a find in files for .i and .p.