grep-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Grep-devel] proposed new function for dfa


From: Norihiro Tanaka
Subject: Re: [Grep-devel] proposed new function for dfa
Date: Thu, 24 Nov 2016 08:14:08 +0900

On Wed, 23 Nov 2016 13:42:25 -0800
Paul Eggert <address@hidden> wrote:

How about the following idea instead?
> 
> * Add an opaque type 'struct dfasyntax' to dfa.h.
> 
> * dfacomp accepts a new 'struct dfasyntax *' arg, specifying the syntax.
> 
> * dfasyntax no longer accepts a 'struct dfa *' arg.  Instead, it
> returns a pointer of type 'struct dfasyntax *' to a newly allocated
> opaque object O that contains all the info that dfasyntax currently
> computes.  O can be freed via 'free'; this shouldn't happen as long as
> anyone is using a struct dfa object for which dfacomp has specified O.

dfasyntax() may have overhead, if a pattern is short and simple.
dfasyntax() calculates context for all bytes every time called.  How
does move following to localeinfo?

  for (i = CHAR_MIN; i <= CHAR_MAX; ++i)
    {
      ...
    }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]