From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Engster Newsgroups: gmane.emacs.devel Subject: Re: CEDET merge question Date: Sat, 12 Sep 2009 18:34:49 +0200 Message-ID: <87vdjoruja.fsf@engster.org> References: <87eiql2w5s.fsf@cyd.mit.edu> <87k50bixsl.fsf@engster.org> <1252759780.4770.76.camel@projectile.siege-engine.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1252773499 10991 80.91.229.12 (12 Sep 2009 16:38:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Sep 2009 16:38:19 +0000 (UTC) Cc: cyd@stupidchicken.com, raeburn@raeburn.org, rms@gnu.org, emacs-devel@gnu.org To: eric@siege-engine.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 12 18:38:11 2009 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 1MmVc2-0006ad-94 for ged-emacs-devel@m.gmane.org; Sat, 12 Sep 2009 18:38:10 +0200 Original-Received: from localhost ([127.0.0.1]:49703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmVc1-000679-PF for ged-emacs-devel@m.gmane.org; Sat, 12 Sep 2009 12:38:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MmVZ3-00019z-Dp for emacs-devel@gnu.org; Sat, 12 Sep 2009 12:35:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MmVZ2-00017s-E7 for emacs-devel@gnu.org; Sat, 12 Sep 2009 12:35:04 -0400 Original-Received: from [199.232.76.173] (port=45062 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmVZ2-00017f-68 for emacs-devel@gnu.org; Sat, 12 Sep 2009 12:35:04 -0400 Original-Received: from m61s02.vlinux.de ([83.151.21.164]:45509) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MmVYw-00014S-FK; Sat, 12 Sep 2009 12:34:58 -0400 Original-Received: from dslc-082-083-042-072.pools.arcor-ip.net ([82.83.42.72] helo=void) by m61s02.vlinux.de with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1MmVYp-0006i9-ME; Sat, 12 Sep 2009 18:34:51 +0200 In-Reply-To: <1252759780.4770.76.camel@projectile.siege-engine.com> (Eric M. Ludlam's message of "Sat, 12 Sep 2009 08:49:40 -0400") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:115233 Archived-At: Eric M. Ludlam writes: > On Mon, 2009-09-07 at 09:33 -0400, Richard Stallman wrote: >> CEDET uses Bison grammars which are extended through "Optional Lambda >> Expressions" (OLE). They produce the actual tags, which are the basic >> objects resulting from the parsing stage. I don't think this can be >> easily replaced by Bison itself or Guile. >> >> Why is it hard to add these to Bison? >> It can handle embedded C code, so why not embedded Lisp code? >> It should be straightforward to make such changes. [...] > A very similar question to "why not make bison support Emacs Lisp > output", is "why not have gcc support tagging output". > > If gcc supported a tagging output format with the details needed for > CEDET to get its job done, it could just call out to gcc instead of > parsing it in Emacs. CEDET would then magically support a lot more > languages. Yes, I think that would be the way to go. Some time ago, I looked at a way to add Fortran 90/95 parsing to CEDET. It seems there's no free Bison grammar out there, but there is for example g95-xml [1], which apparently reuses the g95 parser and produces a XML output file, which could then be converted to Emacs Lisp tags. Also, in gfortran, there is a debug option '-fdump-parse-tree', which seems to produce an output almost usable by Semantic (most importantly, it's missing any source code information like line numbers, etc.). Similar to g95-xml, there's gcc-xml [2], which uses gcc's C++ parser to output a XML file. But it seems its development has stalled, and it currently can't parse templates, for example. One problem with this approach is how the parser reacts to 'code in progress', meaning syntactically incorrect code which is, for example, lacking some closing statements. I think that g95-xml just aborted in this case, which is why I never went further with this project. -David [1] http://sourceforge.net/projects/g95-xml/ [2] http://www.gccxml.org/HTML/Index.html