From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: State-machine based syntax highlighting Date: Fri, 08 Dec 2006 19:10:30 +1100 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <87psaukdu1.fsf@lion.rapttech.com.au> References: <1165472049.496117.320630@79g2000cws.googlegroups.com> <1165488825.132862.189340@79g2000cws.googlegroups.com> <1165492567.864982.59980@79g2000cws.googlegroups.com> <1165495364.560960.271250@f1g2000cwa.googlegroups.com> <1165501630.172348.157180@j72g2000cwa.googlegroups.com> <1165502373.932709.15860@79g2000cws.googlegroups.com> <1165510932.276718.251220@73g2000cwn.googlegroups.com> <1165516558.657188.21610@j44g2000cwa.googlegroups.com> <1165517838.526624.171950@f1g2000cwa.googlegroups.com> <1165563183.140436.326110@16g2000cwy.googlegroups.com> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1165567400 24774 80.91.229.10 (8 Dec 2006 08:43:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 8 Dec 2006 08:43:20 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 08 09:43:18 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GsbK4-0005zB-Ap for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Dec 2006 09:43:12 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GsbK3-0003Ek-NT for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Dec 2006 03:43:11 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!sn-xt-sjc-02!sn-xt-sjc-09!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) Cancel-Lock: sha1:5iGT0I5hwVLsiRm1soc5jcvS2C4= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 43 Original-Xref: shelby.stanford.edu gnu.emacs.help:143740 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:39342 Archived-At: "spamfilteraccount@gmail.com" writes: > Robert Thorpe wrote: >> >> If parsing were to be used to support syntax highlighting then maybe >> some work would have to be done to avoid having to use Elisp. But I'm >> not sure since it would still require loads of regexps and they would >> probably still eat up a lot of the runtime. >> > > That may be true, but the advantage is that parsing actually > understands code, not just matches it with some regexps, so it could be > used for much more than syntax highlighting (some kind of error > checking, code completion, etc.). > > I think if there are already parsers written in elisp they should be > intergrated into the official emacs distribution (e.g. in directory > lisp/parsers), so that packages can use them to understand the code > better. > Have a look at http://cedet.sourceforge.net/ The combination of semantic and cedet is, amongst other things, aimed at providing parse based functionality for emacs. some of this is (I think) going to be bundled in with emacs 22. The idea is to provide a more powerful devleopment environment that can do things like code completion based on more than just abbrevs and dynamic completion based on recently used keywords and regexp. The problem with parse based analysis is that you need an in-built parser for all the languages that the editor is used to develop in and this is not a trivial task. I suspect some sort of plugin architecture that is able to use stand-alone parses for some language of interest would probably be the way to go as it is unlikely even a small subset of the languages devleoped within an emacs environment can have a parser developed in elisp which is readily maintained. Tim -- tcross (at) rapttech dot com dot au