From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Eric M. Ludlam" Newsgroups: gmane.emacs.devel Subject: Re: CEDET merge question Date: Sat, 12 Sep 2009 08:49:40 -0400 Message-ID: <1252759780.4770.76.camel@projectile.siege-engine.com> References: <87eiql2w5s.fsf@cyd.mit.edu> <87k50bixsl.fsf@engster.org> Reply-To: eric@siege-engine.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1252759896 333 80.91.229.12 (12 Sep 2009 12:51:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Sep 2009 12:51:36 +0000 (UTC) Cc: cyd@stupidchicken.com, raeburn@raeburn.org, David Engster , emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 12 14:51:28 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 1MmS4c-0007OD-EA for ged-emacs-devel@m.gmane.org; Sat, 12 Sep 2009 14:51:26 +0200 Original-Received: from localhost ([127.0.0.1]:59433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmS4b-0008Ly-PV for ged-emacs-devel@m.gmane.org; Sat, 12 Sep 2009 08:51:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MmS4W-0008Jt-Ks for emacs-devel@gnu.org; Sat, 12 Sep 2009 08:51:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MmS4W-0008JX-9L for emacs-devel@gnu.org; Sat, 12 Sep 2009 08:51:20 -0400 Original-Received: from [199.232.76.173] (port=52663 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmS4W-0008JU-42 for emacs-devel@gnu.org; Sat, 12 Sep 2009 08:51:20 -0400 Original-Received: from static-71-184-83-10.bstnma.fios.verizon.net ([71.184.83.10]:44193 helo=projectile.siege-engine.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MmS4V-00078P-5D for emacs-devel@gnu.org; Sat, 12 Sep 2009 08:51:19 -0400 Original-Received: from projectile.siege-engine.com (localhost [127.0.0.1]) by projectile.siege-engine.com (8.14.3/8.14.3/Debian-6) with ESMTP id n8CCneVr029758; Sat, 12 Sep 2009 08:49:41 -0400 Original-Received: (from zappo@localhost) by projectile.siege-engine.com (8.14.3/8.14.3/Submit) id n8CCnebA029757; Sat, 12 Sep 2009 08:49:40 -0400 X-Authentication-Warning: projectile.siege-engine.com: zappo set sender to eric@siege-engine.com using -f In-Reply-To: X-Mailer: Evolution 2.26.1 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:115225 Archived-At: 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. I don't know how bison works, but I would assume that bison parses basic C code (thus replacing $1 with some other piece of code.) In the same way, it would need to be taught about Emacs Lisp, Scheme, or any other language someone might want. Bison also outputs the code needed for traversing the generated parser table. When creating more than one parser in one application (ie - any scripting language case) this would be detrimental since it is basically the same code for every parser, which is wasteful. That said, I do think that it is possible, and maybe even desirable to do such a thing. The end result, however, would involve rather extreme changes to bison, and possibly flex if flex is also used. As others have pointed out, there are newer parser technologies available too such as PEG. How much of that is fad vs fabulous, I don't really know. What I do know is that the CEDET tools don't care much about the specifics of the parser. The parser tools it does have are to make it easy to create new parsers so Emacs can support a large number of languages. 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. There are a huge number of tools out there trying to do what gcc does, like ctags, etags, ectags, cscope, gnu global, doxygen, and idutils. What's worse is that none of them work well. Of course, an Emacs Lisp parser can do lots of other things besides create tags. That's just what it is currently used for. Eric