From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Robert Thorpe" Newsgroups: gmane.emacs.help Subject: Re: State-machine based syntax highlighting Date: 7 Dec 2006 02:53:45 -0800 Organization: http://groups.google.com Message-ID: <1165488825.132862.189340@79g2000cws.googlegroups.com> References: <1165472049.496117.320630@79g2000cws.googlegroups.com> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: sea.gmane.org 1165491639 22046 80.91.229.10 (7 Dec 2006 11:40:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 7 Dec 2006 11:40:39 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 07 12:40:36 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 1GsHc2-0000Z5-KO for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Dec 2006 12:40:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GsHc2-000408-6O for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Dec 2006 06:40:26 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!news.glorb.com!postnews.google.com!79g2000cws.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 25 Original-NNTP-Posting-Host: 163.244.62.65 Original-X-Trace: posting.google.com 1165488831 12419 127.0.0.1 (7 Dec 2006 10:53:51 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 7 Dec 2006 10:53:51 +0000 (UTC) In-Reply-To: <1165472049.496117.320630@79g2000cws.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.0 EMF1ASPROXY03 Complaints-To: groups-abuse@google.com Injection-Info: 79g2000cws.googlegroups.com; posting-host=163.244.62.65; posting-account=hWoAPxMAAAAnBKSBz1ZivwUPPjEuve7bvVCHZQ8rhrluPfwcBJd92w Original-Xref: shelby.stanford.edu gnu.emacs.help:143709 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:39311 Archived-At: spamfilteraccount@gmail.com wrote: > I just read that in the text editor FTE does syntax highlighting can be > defined with state-machines. > > Here's a LUA example I found: http://t-o-m-e.net/tmp/m_lua.fte > > Does anyone know the dis/advantages of this method compared to the > regexp-based emacs approach? Regexp are state machines. Or, to be more precise the regexp engine compiles regexp it is given into discrete finite state machines. Defining state machines manually is usually worse than generating them from regexp normally, because a human cannot do the regexp optimizations that the regexp engine can. In my view the real way to improve Emacs syntax highlighting would be to make it based on parsing. > E.g. would it work faster than the current > emacs implementation? Do you have a problem with the speed of a regexp you have written? If so it's probably down to the regexp or the way you're trying to do things. Post the code here and someone may be able to help you.