Re: Understanding regxp implementation

2007-03-22 Thread Asiri Rathnayake
On Thu, 2007-03-22 at 22:21 +0100, Bram Moolenaar wrote: > > Adding a third matcher won't happen soon, and is a big change. It's not > really needed to prepare for that. > > The disadvantage of using a function pointer is that in the place where > it's used you only see: > > myprog->e

Re: Understanding regxp implementation

2007-03-22 Thread Bram Moolenaar
Nikolai Weibull wrote: > On 3/22/07, Asiri Rathnayake <[EMAIL PROTECTED]> wrote: > > > As you might know, the reg_comp() method is called twice when compiling > > a r.e; first to determine the size of the compiled expression and then > > to actually compile it. I was thinking if this can be used

Re: Understanding regxp implementation

2007-03-22 Thread Asiri Rathnayake
On Thu, 2007-03-22 at 09:26 +0100, Nikolai Weibull wrote: > On 3/22/07, Asiri Rathnayake <[EMAIL PROTECTED]> wrote: > > > As you might know, the reg_comp() method is called twice when compiling > > a r.e; first to determine the size of the compiled expression and then > > to actually compile it. I

Re: Understanding regxp implementation

2007-03-22 Thread Nikolai Weibull
On 3/22/07, Asiri Rathnayake <[EMAIL PROTECTED]> wrote: As you might know, the reg_comp() method is called twice when compiling a r.e; first to determine the size of the compiled expression and then to actually compile it. I was thinking if this can be used to our advantage, while on the first p

Re: Understanding regxp implementation

2007-03-21 Thread Asiri Rathnayake
Nikolai, As you might know, the reg_comp() method is called twice when compiling a r.e; first to determine the size of the compiled expression and then to actually compile it. I was thinking if this can be used to our advantage, while on the first pass, we look for occurrences of special character

Re: Understanding regxp implementation

2007-03-21 Thread Asiri Rathnayake
This mail bounced off for some reason, I'm repeating it. Sorry if you've already got this. - Hi Bram, Nikolai, All, I think the best way to understand current implementation of regxp is to first go through Henry Spencer's original regxp implementation ( thanks nikolai ). It's ver

Re: Understanding regxp implementation

2007-03-20 Thread Nikolai Weibull
On 3/20/07, Asiri Rathnayake <[EMAIL PROTECTED]> wrote: I went through the regxp code and have a few questions... First, Why use this kind of a coding scheme and encode patterns rather than using a state diagram ? ( Performance/Memory ? ). Because that's how Henry Spencer did it. I don't kno

Re: Understanding regxp implementation

2007-03-20 Thread Asiri Rathnayake
Hi Bram,Nikolai, I went through the regxp code and have a few questions... First, Why use this kind of a coding scheme and encode patterns rather than using a state diagram ? ( Performance/Memory ? ). Secondly, is it a requirement that the new implementation has to follow the same method ? I mean

Re: Understanding regxp implementation

2007-03-19 Thread Martin Stubenschrott
On Mon, Mar 19, 2007 at 01:49:53PM +0100, Nikolai Weibull wrote: > On 1/1/07, Asiri Rathnayake <[EMAIL PROTECTED]> wrote: > >On Mon, 2007-03-19 at 11:55 +0100, Nikolai Weibull wrote: > >> On 3/19/07, Asiri Rathnayake <[EMAIL PROTECTED]> wrote: > >> > Hi Bram, Nicolai, > >> > >> A 'k' would be great

Re: Understanding regxp implementation

2007-03-19 Thread Nikolai Weibull
On 1/1/07, Asiri Rathnayake <[EMAIL PROTECTED]> wrote: On Mon, 2007-03-19 at 11:55 +0100, Nikolai Weibull wrote: > On 3/19/07, Asiri Rathnayake <[EMAIL PROTECTED]> wrote: > > Hi Bram, Nicolai, > > A 'k' would be greatly appreciated. I'm really really sorry, won't happen again... Hehe, don't ta

Re: Understanding regxp implementation

2007-03-19 Thread Asiri Rathnayake
On Mon, 2007-03-19 at 11:55 +0100, Nikolai Weibull wrote: > On 3/19/07, Asiri Rathnayake <[EMAIL PROTECTED]> wrote: > > Hi Bram, Nicolai, > > A 'k' would be greatly appreciated. I'm really really sorry, won't happen again... > > I'm unable to grasp the description ( attachment ) given in the reg

Re: Understanding regxp implementation

2007-03-19 Thread Nikolai Weibull
On 3/19/07, Asiri Rathnayake <[EMAIL PROTECTED]> wrote: Hi Bram, Nicolai, A 'k' would be greatly appreciated. I'm unable to grasp the description ( attachment ) given in the regxp.c file. For a moment they seem like NFA fragments for operators |,+,* Well, yes, that's what they are. The dia

Understanding regxp implementation

2007-03-19 Thread Asiri Rathnayake
Hi Bram, Nicolai, I'm unable to grasp the description ( attachment ) given in the regxp.c file. For a moment they seem like NFA fragments for operators |,+,* and so on, but then again I'm in doubt ( specially i don't understand what a node in this context is ). A little help is greatly appreciated