Machine definitions w/ arguments?

Carlos Antunes cmantu... at gmail.com
Wed Jul 23 04:09:56 UTC 2008


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