From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "lucatrv" Newsgroups: gmane.emacs.devel Subject: Re: Add fortran 90 modules indexing to etags Date: Tue, 5 Jun 2007 10:15:39 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1181031385 5774 80.91.229.12 (5 Jun 2007 08:16:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 5 Jun 2007 08:16:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Francesco Potorti`" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 05 10:16:24 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HvUDH-0004WD-0F for ged-emacs-devel@m.gmane.org; Tue, 05 Jun 2007 10:16:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HvUDF-00013A-2m for ged-emacs-devel@m.gmane.org; Tue, 05 Jun 2007 04:16:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HvUDC-00012z-6z for emacs-devel@gnu.org; Tue, 05 Jun 2007 04:16:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HvUD6-0000zg-OW for emacs-devel@gnu.org; Tue, 05 Jun 2007 04:16:17 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HvUD6-0000zd-LK for emacs-devel@gnu.org; Tue, 05 Jun 2007 04:16:12 -0400 Original-Received: from bay0-omc3-s7.bay0.hotmail.com ([65.54.246.207]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HvUCx-0004JV-Da; Tue, 05 Jun 2007 04:16:03 -0400 Original-Received: from hotmail.com ([65.54.174.78]) by bay0-omc3-s7.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Tue, 5 Jun 2007 01:15:55 -0700 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 5 Jun 2007 01:15:55 -0700 Original-Received: from 137.204.63.150 by BAY103-DAV6.phx.gbl with DAV; Tue, 05 Jun 2007 08:15:50 +0000 X-Originating-IP: [137.204.63.150] X-Originating-Email: [lucatrv@hotmail.com] X-Sender: lucatrv@hotmail.com X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-OriginalArrivalTime: 05 Jun 2007 08:15:55.0114 (UTC) FILETIME=[BD2554A0:01C7A749] X-detected-kernel: Windows 2000 SP4, XP SP1+ X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:72266 Archived-At: A module statement in fortran 90 is quite simple: module module-name ... end [module [module-name]] module-name can be alphanum and _ [] means optional. Of course, fortran is case insensitive. Be careful that the following statement: module procedure procedure-name is not a module statement, but rather a procedure declaration in a fortran interface (which should not be tagged). I actually realized now that the regexp I was using is not correct, since it would tag "procedure" in this case. Here is what I think is the most correct regexp to tag module declarations: --regex="{fortran}/[[:blank:]]*module[[:blank:]]+[_[:alnum:]]+[[:blank:]]*$/i" Here is a sample code: MODULE TEST USE TEST2 ! use a module "test2", declared somewhere else IMPLICIT NONE REAL :: A, B, C INTERFACE TWICE MODULE PROCEDURE STWICE, DTWICE END INTERFACE TWICE CONTAINS REAL FUNCTION STWICE(X) REAL, INTENT(IN) :: X STWICE = 2.0*X END FUNCTION STWICE DOUBLE PRECISION DTWICE(X) DOUBLE PRECISION, INTENT(IN) :: X DTWICE = 2.0D0*X END FUNCTION DTWICE END MODULE TEST It provides three functions. STWICE and DTWICE are specific respectively for real od double precision arguments. TWICE is a generic interface which actually calls the right one depending on the argument type. Now, I think the best would be to add also interface statement support to etags... In this case the situation is similar, the statements which should be tagged are like this: interface procedure-name ... end interface [interface-name] interface-name can be alphanum and _ Take care that the "interface" statement can also not declare a procedure-name, in this case it should not be tagged, since it does not provide any new function name (it is used only to check arguments during compilation). So the following should not be tagged: interface .... end interface Finally, the interface statement can also provide overloading to an operator or to the assignment. for instance interface operator(+) ... end interface [operator(+)] interface assignment(=) ... end interface [assignment(=)] In this case, I'm not sure what should be tagged... it depends on what etags does whith similar statements in C and C++. Let me know if you need more information. Thank you very much, Luca ----- Original Message ----- From: "Francesco Potorti`" To: "lucatrv" Cc: Sent: Monday, June 04, 2007 11:16 PM Subject: Re: Add fortran 90 modules indexing to etags >I will try to implement support for Fortran 90 modules. > > Please send me a sample Fortran 90 source with modules, with some > explanations of what should be tagged exactly and what are the possible > cases. > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel >