Docsity

Project2: Call Dependency Analysis | CSE 687, Study Guides, Projects, Research of Engineering

Toggle sidebar
bg1
CSE687 - Object Oriented Design S 2003
Project #2 – Call Dependency Analysis due
Monday, Mar 03
Purpose:
This project requires you to build a program that accepts a path and a set of file patterns on the command
line, searches the directory tree rooted at that path, and analyzes each file found for its calling
dependencies. That is, the Calls program finds each function defined in the file, then discovers all the
functions called by those definitions. When analysis is complete, Calls must show each function defined in
each of the files, in alphabetic order, and after the name of each defined function show all the functions it
calls directly and indirectly in an indented format.
fun1 function defined in analyzed file
fun2 called by fun1
fun4 called by fun2
fun5 called by fun2
fun3 called by fun1
fun2 defined in file as well as called by fun1
fun4 called by fun2
fun5 called by fun2
Here the names fun1, …, fun5 stand for the fully qualified function names. That is, they show namespace
and class cscope, like this, where CSE687 is the namespace in which class Anal is embedded:
bool CSE687::Anal::analyze(const std::string &file);
If fun3, fun4, and fun5 were all defined in other files, then this would be the entire display of data from the
analyzed file. Note that you are required to show the calling sequence for all files as a single output set.
So, if fun3, fun4, and fun5 are defined in other files, you still show them as calls made by fun1 and fun2.
There are several interesting issues to think about. Can you detect constructor calls? destructor calls?
operator calls? Should you do the analysis iteratively or recursively? In a single pass or in multiple passes?
If you choose a recursive analysi s what happens when there are recursive calls in the file analyzed? Should
you show calls into the standard libraries and system libraries? Note that you can’t follow the call chain into
those libraries, as you don’t have their source code readily available.
Requirements:
Your HTMLDoc program:
1. shall use standard C++1 and the standard library, compile and link from the command line, using
VC++ 7.0, as provided in the ECS clusters and operate in the environment provided there2.
2. shall use services of the C++ iostream library for all input and output to and from the user’s
console and C++ operator new and delete for all dynmic memory management, if you use any.
3. shall accept, from the command line, a path name to begin searching for files, and a set of one or
more file name patterns.
4. shall display the set of all calling relationships defined across the entire set of analyzed files.
5. shall display both direct and indirect calling relationships in the indented format shown in the
Purpose section.
6. shall use a template-based policies to determine whether full function signatures are show or just
the function name decorated with its namespace and class scope. You also might want to use a
1 This means, for example that you may not use the .Net managed extensions to C++.
2 VC++ ver 7.0 is Visual Studio .Net and is available in all but the CST 2-122 cluster.
pf2

Partial preview of the text

Download Project2: Call Dependency Analysis | CSE 687 and more Study Guides, Projects, Research Engineering in PDF only on Docsity!

CSE687 - Object Oriented Design S 2003

Project #2 – Call Dependency Analysis due

Monday, Mar 03

Purpose:

This project requires you to build a program that accepts a path and a set of file patterns on the command line, searches the directory tree rooted at that path, and analyzes each file found for its calling dependencies. That is, the Calls program finds each function defined in the file, then discovers all the functions called by those definitions. When analysis is complete, Calls must show each function defined in each of the files, in alphabetic order, and after the name of each defined function show all the functions it calls directly and indirectly in an indented format. fun1 function defined in analyzed file fun2 called by fun fun4 called by fun fun5 called by fun fun3 called by fun fun2 defined in file as well as called by fun fun4 called by fun fun5 called by fun Here the names fun1, …, fun5 stand for the fully qualified function names. That is, they show namespace and class cscope, like this, where CSE687 is the namespace in which class Anal is embedded: bool CSE687::Anal::analyze(const std::string &file); If fun3, fun4, and fun5 were all defined in other files, then this would be the entire display of data from the analyzed file. Note that you are required to show the calling sequence for all files as a single output set. So, if fun3, fun4, and fun5 are defined in other files, you still show them as calls made by fun1 and fun2. There are several interesting issues to think about. Can you detect constructor calls? destructor calls? operator calls? Should you do the analysis iteratively or recursively? In a single pass or in multiple passes? If you choose a recursive analysis what happens when there are recursive calls in the file analyzed? Should you show calls into the standard libraries and system libraries? Note that you can’t follow the call chain into those libraries, as you don’t have their source code readily available.

Requirements:

Your HTMLDoc program:

  1. shall use standard C++^1 and the standard library, compile and link from the command line, using VC++ 7.0, as provided in the ECS clusters and operate in the environment provided there^2.
  2. shall use services of the C++ iostream library for all input and output to and from the user’s console and C++ operator new and delete for all dynmic memory management, if you use any.
  3. shall accept, from the command line, a path name to begin searching for files, and a set of one or more file name patterns.
  4. shall display the set of all calling relationships defined across the entire set of analyzed files.
  5. shall display both direct and indirect calling relationships in the indented format shown in the Purpose section.
  6. shall use a template-based policies to determine whether full function signatures are show or just the function name decorated with its namespace and class scope. You also might want to use a (^1) This means, for example that you may not use the .Net managed extensions to C++. (^2) VC++ ver 7.0 is Visual Studio .Net and is available in all but the CST 2-122 cluster.

CSE687 - Object Oriented Design S 2003 trait to use the “.” Scope resolution operator for C#, instead of the “::” scope resolution used for C+ +.