[ragel-users] Scanner and distributing the code.

Adrian Thurston thurston at complang.org
Sun Aug 23 19:54:33 UTC 2009


Look at the pull scanner example.

http://svn.complang.org/ragel/trunk/examples/pullscan.rl

-Adrian

Alessio Giovanni Baroni wrote:
> Yes, but the first call consume ALL input! I will want consuming only 1 
> token.
> This code not run:
> 
> %%{
> main := |* ...... *|;
> }%%
> 
> lexer *lexer_new(...)
> {
>        %% write init;
> }
> 
> token *lexer_next(....)
> {
>      %% write exec;
> }
> 
> Regards.
> 
> 
> 2009/8/22 Adrian Thurston <thurston at complang.org 
> <mailto:thurston at complang.org>>
> 
>     Yes, you can do that.
> 
>     Adrian
> 
>     Alessio Giovanni Baroni wrote:
>      > Hello,
>      > if I use the scanner (|* ..... *|), a call to %% write exec
>     consume all
>      > input. And if I want inserting %%write init in,
>      > for example, a constructor and %%write exec in a method, to
>     retrieve one
>      > token at every call?
>      >
>      > Thanks!
>      >
>      >
>      >
>     ------------------------------------------------------------------------
>      >
>      > _______________________________________________
>      > ragel-users mailing list
>      > ragel-users at complang.org <mailto:ragel-users at complang.org>
>      > http://www.complang.org/mailman/listinfo/ragel-users
> 
>     _______________________________________________
>     ragel-users mailing list
>     ragel-users at complang.org <mailto:ragel-users at complang.org>
>     http://www.complang.org/mailman/listinfo/ragel-users
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ragel-users mailing list
> ragel-users at complang.org
> http://www.complang.org/mailman/listinfo/ragel-users




More information about the ragel-users mailing list