From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Eric M. Ludlam" Newsgroups: gmane.emacs.cedet,gmane.emacs.help Subject: Re: Refactoring with CEDET Date: Sat, 3 May 2008 08:02:05 -0400 Message-ID: <200805031202.m43C25xW013560@projectile.siege-engine.com> References: <001901c8ad07$1c740140$ea0a90d4@j4f3n1> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1209816152 7714 80.91.229.12 (3 May 2008 12:02:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 May 2008 12:02:32 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, cedet-devel@lists.sourceforge.net To: "grischka" Original-X-From: cedet-devel-bounces@lists.sourceforge.net Sat May 03 14:03:06 2008 Return-path: Envelope-to: sf-cedet-devel@m.gmane.org Original-Received: from lists-outbound.sourceforge.net ([66.35.250.225]) by lo.gmane.org with esmtp (Exim 4.50) id 1JsGSF-0005zp-96 for sf-cedet-devel@m.gmane.org; Sat, 03 May 2008 14:03:03 +0200 Original-Received: from sc8-sf-list1-new.sourceforge.net (sc8-sf-list1-new-b.sourceforge.net [10.3.1.93]) by sc8-sf-spam2.sourceforge.net (Postfix) with ESMTP id BF436FD1A; Sat, 3 May 2008 05:02:19 -0700 (PDT) Original-Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1JsGRW-0002gs-KB for cedet-devel@lists.sourceforge.net; Sat, 03 May 2008 05:02:18 -0700 Original-Received: from static-71-184-83-10.bstnma.fios.verizon.net ([71.184.83.10] helo=projectile.siege-engine.com) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1JsGRT-0006et-TV for cedet-devel@lists.sourceforge.net; Sat, 03 May 2008 05:02:18 -0700 Original-Received: from projectile.siege-engine.com (localhost.localdomain [127.0.0.1]) by projectile.siege-engine.com (8.12.8/8.12.8) with ESMTP id m43C26Zi013564; Sat, 3 May 2008 08:02:06 -0400 Original-Received: (from zappo@localhost) by projectile.siege-engine.com (8.12.8/8.12.8/Submit) id m43C25xW013560; Sat, 3 May 2008 08:02:05 -0400 In-reply-to: <001901c8ad07$1c740140$ea0a90d4@j4f3n1> (grishka@gmx.de) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by sourceforge.net. See http://spamassassin.org/tag/ for more details. Report problems to http://sf.net/tracker/?func=add&group_id=1&atid=200001 X-BeenThere: cedet-devel@lists.sourceforge.net X-Mailman-Version: 2.1.8 Precedence: list List-Id: Development discussions for CEDET projects List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: cedet-devel-bounces@lists.sourceforge.net Errors-To: cedet-devel-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.emacs.cedet:2737 gmane.emacs.help:53738 Archived-At: Hi, The CEDET infrastructure does not currently support everything you are looking to do. Details below: >>> "grischka" seems to think that: >Hi, > >I have some code where I want to convert a bunch of (~100) global >variables into members of a structure. That means: > >- find all functions that use these variables CEDET/Semantic does not parse the contents of functions. This is for two reasons. 1) Speed up parsing. 2) Speed up writing parsers. >- patch their declarations to take the struct* as additional parameter > int func(int x) ==> int func(State *s, int x) The ability to perform this permutation is in CEDET/Srecode (CVS version only), but there is no user-facing routine built for this situation. Also, the way routines like this are built is still in a testing stage. If anyone wants to try this, I'll help you out. >- insert the struct* as one more argument into calls to these functions > func(n); ==> func(s, n); There is some very basic infrastructure in this area for identifying function argument locations, but nothing concrete. >- prefix all occurrences of the variables with the struct pointer > var ==> s->var Again, an issue with finding the users. >Is it possible to do this (semi-?) automatically with CEDET? The CEDET infrastructure has focused on declarative tools, and would form a fine baseline for tools like this, but it does not support it now. The most glaring issue is that function bodies are not parsed. Databases of how things are assembled seems best suited to compilers or, failing that, perhaps grep or a textual indexer. For languages that use include like syntax, CEDET could tell you all files that reference the include which could be used in a grep call. CEDET could then tell you if a grep hit were an actual use or not and help move your cursor. The template system would let you craft templates for insertion. Refactoring operations have been on my todo list for a long time but have been blocked by the building of the infrastructure. Eric -- Eric Ludlam: eric@siege-engine.com Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone