unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Thomas Lord <lord@emf.net>
Cc: Chong Yidong <cyd@stupidchicken.com>,
	192@emacsbugs.donarmstrong.com, emacs-devel@gnu.org,
	martin rudalics <rudalics@gmx.at>,
	David Koppelman <koppel@ece.lsu.edu>,
	Bruno Haible <bruno@clisp.org>
Subject: Re: regexp does not work as documented
Date: Mon, 12 May 2008 09:43:49 -0400	[thread overview]
Message-ID: <jwvfxsnpryp.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <4827B9B8.30406@emf.net> (Thomas Lord's message of "Sun, 11 May 2008 20:30:00 -0700")

> years ago, is to consider *offline* DFA conversion (a la 'lex(1)').

That's what I do in lex.el.

> The advantage of offline (batch) conversion is that you can burn a lot
> of cycles on DFA minimization and, if your offline converter
> terminates, you've got a reliably linear matcher.  The disadvantages
> for *many* uses of regular expressions in Emacs should be pretty
> obvious.  For something like font-lock, where the regular expressions
> don't change that often, that might be a good approach -- precompile
> a minimal DFA and then add support for "regular expression
> continuations" when using those tables.

I do not intend to replace src/regexp.c with a matcher based on offline
DFA conversion.  Actually, the need to support backrefs makes it pretty
much impossible (tho I'm sure there's a way to adapt an offline DFA so
it can be used with backrefs), and most importantly it has too different
performance characteristics.  More specifically, the compilation step
should be made explicit.

In any case I think you did answer my question: an offline DFA matcher
is fine, the worst case is not that common and can be worked around.
This is not that different from the current backtracking matcher.


        Stefan


PS: The original motivation for a DFA-matcher is to extend syntax-tables
so they can match match multi-char elements.




  reply	other threads:[~2008-05-12 13:43 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-06  4:20 regexp does not work as documented Chong Yidong
2008-05-06 11:35 ` Bruno Haible
2008-05-06 12:12   ` martin rudalics
2008-05-10 19:18     ` David Koppelman
2008-05-10 20:13       ` David Koppelman
2008-05-11  7:40         ` martin rudalics
2008-05-11 14:27           ` Chong Yidong
2008-05-11 15:36             ` David Koppelman
2008-05-11 18:44               ` Stefan Monnier
2008-05-11 19:09                 ` David Koppelman
2008-05-12  1:28                   ` Stefan Monnier
2008-05-12 15:03                     ` David Koppelman
2008-05-12 16:29                       ` Stefan Monnier
2008-05-12 17:04                         ` David Koppelman
2008-05-11 18:44             ` Stefan Monnier
2008-05-11 20:03               ` Thomas Lord
2008-05-12  1:43                 ` Stefan Monnier
2008-05-12  3:30                   ` Thomas Lord
2008-05-12 13:43                     ` Stefan Monnier [this message]
2008-05-12 15:55                       ` Thomas Lord
2008-05-12 16:18                         ` tomas
2008-05-06 15:35   ` Stefan Monnier
2008-05-06 21:29     ` Bruno Haible
2008-05-10 20:04     ` Bruno Haible
2008-05-06 15:00 ` David Koppelman
2008-05-06 21:35   ` Bruno Haible
2008-05-07  1:04     ` Stefan Monnier
2008-05-07  1:08     ` Auto-discovery of multi-line font-lock regexps Stefan Monnier
2008-05-07  3:46       ` Chong Yidong
2008-05-07  4:21         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvfxsnpryp.fsf-monnier+emacsbugreports@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=192@emacsbugs.donarmstrong.com \
    --cc=bruno@clisp.org \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=koppel@ece.lsu.edu \
    --cc=lord@emf.net \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).