Program analysis plays an important role in software development and maintenance. With this method, characteristics of every variable in program can be analyzed. During the period of program analyzing, computing the program slicing by the method of constructing system dependence graph is an efficient way but the work of constructing the system dependence graph is very complicated which often leads to many wrong results. So the algorithm of hierarchy slice is used in this paper. Using the precise results, the whole program can be analyzed and the dependence relation in the program can be discovered quickly.