Is there a good way to convert a scanner grammar to a plain state machine
grammar ?

I'm actually not using ts for backtracking at buffer boundaries. The data I
receive is split in non contiguous buffers, and I want to avoid
re-allocating space and copying data over from previous buffers, for
performance reasons.

Thanks,

Matthieu.

On Feb 21, 2010 12:06 PM, "Adrian Thurston" <[email protected]> wrote:

I would just set ts = 0 before breaking out. Usually the code I use to
manage the buffer when tokens cross buffer boundaries starts with

if ( ts != 0 ) {

}

The idea is that if no token is currently being matched (true when the
buffer actually ends on a token boundary) then there is nothing to do.

It might make sense for ragel to do that automatically, but I don't like
that because it rules out the possibility of making use of ts for the times
when it is actually wanted.

-Adrian

Matthieu Tourne wrote:

> >
> > I have a scanner, that if an optional final state is reached can be
> simplified to accept any inp...
> ------------------------------------------------------------------------
>
> _______________________________________________
> ragel-users mailing list
> [email protected]
> http://www.complang.org/mailman/listinfo/ragel-users
>

_______________________________________________
ragel-users mailing list
[email protected]
http://www.complang.org/mailman/listinfo/ragel-users
_______________________________________________
ragel-users mailing list
[email protected]
http://www.complang.org/mailman/listinfo/ragel-users

Reply via email to