C++ Refactoring Tool

Discussion in 'C++' started by Andre Baresel, Dec 27, 2003.

  1. Hello together,

    just a year ago I was searching arround for a tool supporting refactoring
    for c++.
    I've seen implementations for java and was impressed how an IDE can help
    with
    such a feature.

    Just rename classes / member / parameter with a mouse click.
    reduce the size of a method by transforming parts of it into a seperate
    function
    (just by selection and 'do-refactor-out').

    But than the bad news - no C++ IDE does support that. Can you imagine why ?
    Two arguments I've seen during web search:

    - "C++ syntax parsing is hard" I must say - yes it is. Parser
    generators don't get it completly.
    - "C++ has this nasty preprocessing" Am, yes that makes it a little bit
    harder
    - "c++ has these template things" Well, declaration constructs can
    be a little bit more complex ;)

    However, I finally found a project targeting the problem. It is called
    "CppTool" on Sourceforge.
    A name not very impressive and it started in late 2001. After one year
    discussion about how to write
    a full c++ parser. Some new members created an idea which convinced me.
    Baptiste Lepilleur
    (see CppUnit activities) created the idea of doing "lazy parsing". It is a
    hand written parser, which is
    able to parse only fragments of the code - this is great, since that enables
    us to parse only these parts
    which we need to know about. An example:

    let's say, we know that we are inside a compound statement. that enables us
    to seperate all
    declaration and statements just by searching for ';' Next step is to decide
    if it's a
    declaration or statement.

    Well, and what to say - after 3 month we have this parser can handle full
    files. Not yet getting
    all the details, but this is just a question of time.

    You will ask - what is there now ?
    Important thing first:
    - we implemented some simple refactoring (e.g. local variable rename,
    split declaration)
    - we have an integration for Eclipse and Visual-Studio.
    - we are open to any IDE (as long as the IDE is open for
    plugin/extensions)

    What about these nasty C++ things ?
    - the parser does create an AST for C++ Sources
    - templates in programs can be parsed
    - preprocessing has solved for simple macro replacements
    (we keep them as long as they do not conflict a refactoring)

    After all, we are only two active programmers. Don't you want to take part
    in this
    important project ? Just read the mailing lists "cpptool-develop Archive" or
    contact
    me. I would like to send a first example of the plugins to you.
    Check out the sources, well there's much. But just ask me to seperate
    important things...

    Don't you think that this will be worth ?

    See you soon at CppTool: https://sourceforge.net/projects/cpptool/

    André Baresel
    (netmemberab)

    ----------------------------------------------------------------------------
    -------
    btw) if you scan through the net in todays time you will also see that the
    eclipse project CDT is targeting refactoring, unfortunatly i don't see
    progress
    on this front and they have even not solved the basic problems. The mile
    stones
    tell that some very basic rename feature is planned for summer 2004.
    However,
    I have seen such point also on the time table for this year 2003 - ... I
    really like
    eclipse, however what is with all there programmers working with borland /
    visual studio
    because of this COM/ActiveX features.
     
    Andre Baresel, Dec 27, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Refactorit

    come learn all about refactoring

    Refactorit, Feb 22, 2004, in forum: Java
    Replies:
    0
    Views:
    344
    Refactorit
    Feb 22, 2004
  2. Anonymous user
    Replies:
    2
    Views:
    380
  3. Tabrez Iqbal

    Refactoring Tool for C++

    Tabrez Iqbal, Sep 11, 2003, in forum: C++
    Replies:
    0
    Views:
    451
    Tabrez Iqbal
    Sep 11, 2003
  4. Andre Baresel

    C++ Refactoring Tool

    Andre Baresel, Jan 7, 2004, in forum: C++
    Replies:
    0
    Views:
    8,232
    Andre Baresel
    Jan 7, 2004
  5. Sachin Garg

    Refactoring tool... PLEASE

    Sachin Garg, Jun 24, 2004, in forum: C++
    Replies:
    2
    Views:
    439
    Thierry Miceli
    Jun 24, 2004
Loading...

Share This Page