[Bug c++/15086] New: Feature Request: Function Skeleton Generator

emase at hotmail dot com gcc-bugzilla@gcc.gnu.org
Fri Apr 23 01:33:00 GMT 2004


One of the most annoying things about C++ is the amount of redundant symbol 
info between prototype declarations and function/method implementations. This 
is further compounded with C++'s object syntax. Since it seems like revising 
C++'s spec is out of the question, would it be possible to build a skeleton 
generator for gcc? The generator would take a file and process all of its 
prototype statements and spit out a skeleton for each one.

Some example statements would be externed global variables, regular function 
prototypes, and (perhaps most importantly) object methods.

For objects the issue of skeletons is quite important because there are certain 
important initializations a skeleton can make (such as default field 
initialization and constructor calling.)

Example:

class Cat
{
  // furry mammal
  Cat();
  int species_id;
  void Speak();
}

class Lion : public Cat
{
  // bigger, louder furry mammal
  Lion();
  void Speak();
};

Ideally a skeleton would generate empty method bodies and copy nearby comments 
like so:

// furry mammal
Cat::Cat()
{
  species_id = 0;     // or even some garbage symbol so that the compiler
                      // would catch it like this:
  // species_id = FIX_ME; // where FIX_ME isn't defined
}

void Cat::Speak()
{

}

// bigger, louder furry mammal
Lion::Lion()
  : Cat()         // insert an explicit call to parent's constructor
                  // maybe match argument list?
{

}

void Lion::Speak()
{

}

-- 
           Summary: Feature Request: Function Skeleton Generator
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: emase at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15086



More information about the Gcc-bugs mailing list