[ragel-users] Re: Feature Request: Inline Scanner

Adrian Thurston thurs... at cs.queensu.ca
Mon Nov 6 06:41:26 UTC 2006


Carlos Antunes wrote:
> concatenation is a pretty simple thing to do. Personally, I don't feel
> the need for capture within capture although it could prove useful in
> certain contexts.

I see, I'll consider that.

> Hmm,  'alltokstarts' could be updated at the beginning of each capture
> with something like min(alltokstarts, ts(n)), no? This would scale
> well.

That works. Another question which I just thought of is how does the 
system know when a user is done with a marker and should update 
alltokstarts? I know you didn't advocate this particular solution in the 
first place, I just thought I'd pose the question. I helps me to figure 
these things out :)

> pattern = (
> 
>     start: ( patA -> matched_patA ),
> 
>     matched_patA: ( |> patB1 => actionB1; patB2 => actionB2; <| ->
> matched_patB ),
> 
>     matched_patB: ( patC -> final )
> 
> );

Ah, okay I get it now. I had thought you were suggesting something more 
complex. This could work fairly well. I have to think about it some 
more. When adding things to the language I like to make things as 
general as possible and that usually takes some time to sort out. But 
ya, I could see it being useful and simple enough to understand and 
implement properly.

> Another thing to consider is whether my initially proposal of strictly
> relying on longest-match for capture makes sense. Maybe the programmer
> should have a choice?
My sudden feeling of enlightenment has not lasted from one paragraph to 
the next ... maybe it's the hour. Do you mean it would be cool to have 
the option to drop a scanner in there?

Cheers,
  Adrian



More information about the ragel-users mailing list