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[2]: CEDET, DL & parsing thoughts (was Release plans) Date: Sat, 30 Aug 2008 05:04:05 -0400 Message-ID: <200808300904.m7U945JI029267@projectile.siege-engine.com> References: <200808300153.m7U1rAxA027402@projectile.siege-engine.com> <48B8AF53.8040501@gmail.com> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1220087606 7297 80.91.229.12 (30 Aug 2008 09:13:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 30 Aug 2008 09:13:26 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Lennart Borgman (gmail)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 30 11:14:17 2008 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 1KZMWt-0002Hm-Mv for ged-emacs-devel@m.gmane.org; Sat, 30 Aug 2008 11:14:00 +0200 Original-Received: from localhost ([127.0.0.1]:41220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZMVu-0000vV-OS for ged-emacs-devel@m.gmane.org; Sat, 30 Aug 2008 05:12:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KZMNR-0007Uk-Bi for emacs-devel@gnu.org; Sat, 30 Aug 2008 05:04:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KZMNO-0007TG-AP for emacs-devel@gnu.org; Sat, 30 Aug 2008 05:04:10 -0400 Original-Received: from [199.232.76.173] (port=40155 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZMNM-0007Sx-HE for emacs-devel@gnu.org; Sat, 30 Aug 2008 05:04:08 -0400 Original-Received: from static-71-184-83-10.bstnma.fios.verizon.net ([71.184.83.10]:58496 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 1KZMNL-0000bF-Q0 for emacs-devel@gnu.org; Sat, 30 Aug 2008 05:04:07 -0400 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 m7U945WB029269; Sat, 30 Aug 2008 05:04:06 -0400 Original-Received: (from zappo@localhost) by projectile.siege-engine.com (8.12.8/8.12.8/Submit) id m7U945JI029267; Sat, 30 Aug 2008 05:04:05 -0400 In-reply-to: <48B8AF53.8040501@gmail.com> (lennart.borgman@gmail.com) X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:103249 Archived-At: >>> "Lennart Borgman (gmail)" seems to think that: >Eric M. Ludlam wrote: >> This is in effect what is in CEDET/Semantic now but without the DL. I >> had made a replacement for flex, but more Emacs Lisp centric, and >> David Ponce ported bison into Emacs Lisp directly. This bison port >> supports incremental parsing, full parsing, reparsing, and is quite >> fast, though not nearly as fast as actual flex/bison/c code. >> >> I would assume the concepts in David Ponce's wisent parser generator >> could be back-ported into Bison if desired. > >So (if I understand currectly from the little I know about this), a bit >sadly, if there were sutiable flex and bison dlls these could be used >instead (if Davids specials were backported too) and would be quite a >bit faster. I can imagine how it *might* be done, though to be honest, it may be that having "eval" actions in the real bison generated parser might be all it takes to slow it down. I would not claim this as an area of expertise. >This does not relate to the general question of loading dll:s. This is a >special case that I suppose Richard would approve. (I have no idea, but >I guess there are no flex and bison dlls availabe, or are there?) It would work like this: 1) lex/grammar file -> flex & bison -> c-files 2) compile flex-bison output + generic interface -> dl 3) load dl, bind generated parser commands to fcns 4) bind those fcns to generic CEDET/Semantic calls 5) Semantic infrastructure calls into the dll for parsing goodness. >However for new languages all this requires also writing language >specific bison grammars. Is this perhaps be a big job that just a few >person have insight in how to do? My goal was to build a tool that would make it easy for anyone to write a parser that would feed into an infrastructure that provides the complex specialy functionality. This is true now for what is in CEDET. There are already 6 grammars that work pretty well that enthusiasts of a particular language have written. (Erlang, python, csharp, javascript, 2 php parsers, and ruby.) >> When I started, I really wanted to have a single generic parsing >> infrastructure that could do indentation, coloring, and tagging. > >nxml-mode does that, but on its own of course. It is my understanding that only nxml, and that new javascript mode do this, making the undertaking a statistically less likely occurance in the current infrastructure. >> Once CEDET is merged into Emacs, I hope to examine some of the speed >> issues with others who know more what Emacs' internals are like. (As >> an FYI, all of CEDET's papers should now be in order for this.) > >Great. Then we can hope for that it is easy to get started using CEDET. I agree. Eric -- Eric Ludlam: eric@siege-engine.com Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net