I have an inter-procedural control flow graph and I want to perform data flow analysis on it. I am using Hashtable for global (level=0), file (level=1) and method (level=2) levels etc. and I push them on the stack starting with level 0.
It works fine as long as I have only one method in the program. But if I have two methods and suppose basicblock#2 from method1 (M1) calls methods (M2), how should I treat this new method symbol table? Should I store the previous symbol table and create a new one for new method?
I see a more complexity when a method of another class is called or nested function calls are made. Can somebody suggest something that how should I handle it?
I am working in Java.
P.S. And I know there are some existing tools like WALA, Soot which might work for this but I am trying to learn that how does it work.