[ragel-users] Machine definitions w/ arguments?

Adrian Thurston thurs... at cs.queensu.ca
Wed Jul 23 20:10:32 UTC 2008


I'm not done yet, but it's getting close :)

A lot of people request this! I'm hoping to work on it in the fall sometime.

Regards,
 Adrian

Carlos Antunes wrote:
> Hello, Adrian!
> 
> How is that thesis coming along? Assuming you are done, how do you see
> the possibility of implementing the addition of arguments to machine
> definitions?
> 
> For example, instead of:
> 
> quoted_string = '"' . string_chars . '"' >{ foo_start(); } %
> { for_stop(); }
> 
> one would define something like this:
> 
> quoted_string(x, y) = '"' . string_chars . '"' >{ (*x)(y); } %{ (*x)
> (y); }
> 
> The 'x', 'y' and 'z' would simply be replaced "macro-style" with
> whatever was found at each actual instantiation. For example:
> 
> expr := quoted_string(callback_func, callback_arg)
> 
> This would allow one to use the same machine definitions in different
> contexts and leading to potentially different actions.
> 
> Thanks!
> 
> Carlos
> 
> 



More information about the ragel-users mailing list