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

Carlos Antunes cmantu... at gmail.com
Mon Nov 6 16:57:41 UTC 2006

On 11/6/06, Adrian Thurston <thurs... at cs.queensu.ca> wrote:
> 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 :)

If you want to support overlapping capture then the user needs to be
able to individually tag each capture start and capture stop with a
unique identifier. This identifier could be a variable and in C could
be a struct with members tokstart and tokend (or 'ts' and 'te'). This
way you'd always know when a capture is starting and ending.

> > 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?

Actually, I wasn't thinking of a scanner although that could be an
option if you think it's useful. I was thinking about just capturing
straight FSM input, in addition to longest-match capture.


"We hold [...] that all men are created equal; that they are
endowed [...] with certain inalienable rights; that among
these are life, liberty, and the pursuit of happiness"
        -- Thomas Jefferson

More information about the ragel-users mailing list