Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Refactoring of AST and Parser code to improve support forRefactoring etc.

This all sounds very interesting; we have implemented support similar to what Garrido did.

I am just confused about the dates. I thought the summit was October 10-11, so I suppose you are talking about another summit ? Will these talks be given at the Eclipste Summit Europe as well ?


-----Original Message-----
From: Chris Recoskie [mailto:recoskie@xxxxxxxxxx] 
Sent: Monday 17 September 2007 16:16
To: CDT General developers list.
Cc: cdt-dev@xxxxxxxxxxx; cdt-dev-bounces@xxxxxxxxxxx; Doug Schaefer; Emanuel@xxxxxxxxxxx; Guido Zgraggen; Lukas Felber; Mirko Stocker; Thomas Corbat; Wuyts Roel
Subject: Re: [cdt-dev] Refactoring of AST and Parser code to improve support forRefactoring etc.

Peter, et al,

The summit is not until next week (Sept 25-27).

The IBM team is planning on doing several presentations at the summit
surrounding parsing and indexing.  Among them is an approach for handling
conditional compilation via pseudo-preprocessing (Garrido's thesis), which
some of you are probably familiar with.  Also we are working on parsing and
indexing strategies that better facilitate extensibiliy and also improve
performance.  The presentations will be posted to the CDT Wiki for
posterity.

As far as Java 5, I don't think we've officially voted on it yet, but it
would seem that we are most likely moving to Java 5 for Ganymede.

===========================

Chris Recoskie
Team Lead, IBM CDT Team
IBM Toronto
http://www.eclipse.org/cdt



                                                                           
             Peter Sommerlad                                               
             <peter.sommerlad@                                             
             hsr.ch>                                                    To 
             Sent by:                  <cdt-dev@xxxxxxxxxxx>               
             cdt-dev-bounces@e                                          cc 
             clipse.org                Wuyts Roel <wuytsr@xxxxxxx>, Mirko  
                                       Stocker <me@xxxxxxxx>, Guido        
                                       Zgraggen <g1zgragg@xxxxxx>,         
             17/09/2007 02:56          Emanuel@xxxxxxxxxxx, Thomas Corbat  
             AM                        <tcorbat@xxxxxx>, Lukas Felber      
                                       <lfelber@xxxxxx>, Doug Schaefer     
                                       <DSchaefer@xxxxxxx>                 
             Please respond to                                     Subject 
               "CDT General            [cdt-dev] Refactoring of AST and    
             developers list."         Parser code to improve support for  
             <cdt-dev@eclipse.         Refactoring etc.                    
                   org>                                                    
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Dear CDT developers,

I would like to suggest that you discuss the following during your
meeting this week:

My vision is to use CDT as a platform for tools that allow C++
developers to analyze and simplify their code. We (IFS institute for
sofwtare)
started already with simple Refactorings, but I believe there is need
for much more.

This implies that we want to rely on CDT's AST and parser code for
our plug-ins. For better relation to the original source, we must
augment the AST and the parser to support "virtual preprocessing",
keeping track of both the "real" C++ as well as the original source
code. Our first addition to allow for keeping track of comments is a
first step but we are not yet able work with it like a breeze.

As a teacher of Refactoring and a frequent code reviewer I see many
potential improvements for the java code and design of CDT's AST and
parser. I asked Doug Schaefer if companies using CDT for their
products  rely heavily on the AST and parser functionality. He told
me that this is not used directly and refactoring this part shouldn't
hurt (much).

The following examples show you areas where we see heavy improvement
possible:
1) Almost all AST object creation methods and the AST
classes' constructors don't use parameters. So at each place where
such an object is constructed, additional calls to setters need to be
made to initialize the object correctly. This is error prone and
leads to code duplication.
2) Another area is a lot of copy-pasted code in the application of the
Visitor design pattern.
3) A third area that looks "smelly" from a Java 5 perspective is the
heavy use of Java arrays as almost the only collection data structure
used. Today, we would be able to use appropriate ArrayList<T> or
SortedSet<T> or others for efficient extension and set operations,
depending on context. This can improve readability of the code and
reduce potential for mistakes in the hand-coded loops.

It would be great if we (IFS) would get the possibility to simplify and
refactor the code of the AST and parser and may be also surrounding
code areas (not a rewrite). This would allow (hopefully) to provide
better unit testing for that code as well and will help us to augment
it with information we need for our refactoring and other tools. A
switch to java 1.5 as the official platform language for CDT could be
used as an "excuse" to do so. It might also give the chance to
improve indexing further (only a guess).

I know, every contributor to CDT did his/her very best and as an
outsider without some of the constraints you all have, it is much
easier to criticize.

We already invested (public and self-earned money) heavily into C++
Refactoring and want to become it a feature that is really useful.
Any sponsoring of our work is appreciated :-)

Tell me, what you think about it and let us Refactor the smelly code,
to make it clean and more usable and extendable in the future.

Cheers
Peter.

--
Prof. Peter Sommerlad

Institut für Software: Bessere Software - Einfach, Schneller!
HSR Hochschule für Technik Rapperswil
Oberseestr 10, Postfach 1475, CH-8640 Rapperswil

http://ifsoftware.ch
tel:+41 55 222 49 84 == mobile:+41 79 432 23 32
fax:+41 55 222 46 29 == mailto:peter.sommerlad@xxxxxx



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev




Back to the top