Can I use SN to ask questions about C++?

Mark Stankus mstankus@calpoly.edu
Sun Sep 24 12:19:00 GMT 2000


 
Dear Source Navigator Developer(s),
 
  I love Source Navigator(SN).
 
  I was wondering if there is an API for SN so that I could write small
programs
(or write data base queries) to ask questions about the C++ code which
has been "SN-ed".
The goal is to look for inefficiencies in C++ code and improve
maintainability of C++
via computer programs.  The questions below are samples (requiring some
SQL would be
fine or, even better, a C++ interface).
 
(Note, if any of the following questions can be answered by an existing
tool,
I would like to know.)
 
Thanks,
Mark Stankus
mstankus@calpoly.edu
 
1) Determine all class names which have a default constructor generated
by the compiler.
2) Determine all class names which have a default constructor generated
by the compiler
   and it is used.
3) Determine all class names which have a copy constructor generated by
the compiler.
4) Determine all class names which have a copy constructor generated by
the compiler
   and it is used.
5) Find all class names which use the macro
USE_GENERATED_DEFAULT_CONSTRUCTOR
6) Find all class names which use the macro
   USE_GENERATED_DEFAULT_CONSTRUCTOR, and define a default constructor.
   ( This would be some "AND" in terms of data base queries or a list
intersection
     for a C++ interface. )
   (BY THE WAY, I would like to start putting EITHER
USE_GENERATED_DEFAULT_CONSTRUCTOR or X()
    but not both in every class X which I write so that my intentions
are clear.)
7) Find all instances of 'bool operator==(unsigned int,int)' in the
code.
   (For example,  int main() {
                    unsigned int a,b;
                    int c;
                    bool d = a==b;
                    bool e = a==c;
                    bool f = 0==1L;
                    bool g = 0U==1;
                    return 0;
                  }
                  would indicate the 'e' and 'g' lines.)         
 
8) Determine all locations where adding the keyword 'explicit' to a
   constructor, say 'X(const Y &)', will create a compiler error.
   (See http://www.calpoly.edu/~mstankus/mozilla )
9) Find all locations where adding the keyword 'explicit' to the code
   wherever appropriate would generate compiler errors.
   (See http://www.calpoly.edu/~mstankus/mozilla )
10) Determine when temporaries are created.


More information about the Sourcenav mailing list