This is more of a vocabulary question. I'm looking for a program that can create a variable dependency tree of any given source code. Here's what I mean:

Say you've got a series of calculations in some code you've written:
A=B+C
D=E+F
G=A+D

You want to know exactly what variables "G" is dependent on. So in this case, G is dependent on A and D. Going deeper, A is dependent on B and C while D is dependent on E and F. The program would trace through the source code, uncover all of these dependencies, and report that G = G( A(B,C), D(E,F) ).

What is a program like this called? I'm imagining something similar to a debugging program, but I'm not sure.

Thanks,
Dan