Karel Sedláček
2012-11-17 21:04:35 UTC
For the purposes of code modularization, it would be very desirable to
be able to do two things:
- redefine (override) machine definitions
- attach actions to definitions separately from their original
definition and without overriding said original definition
Supposing that the former would be implemented such that a
redefinition could reference its previous definition, the latter is
natural; e.g.
%%{
machine ex;
action from_a {
printf("got an A\n");
}
a = ('a');
a = (super | 'A') %from_a;
}%%
Perhaps this is a more moderate proposal to
http://www.complang.org/pipermail/ragel-users/2008-July/001960.html
which would solve some of the same problems. It is also pretty nice
for being able to modularize your Ragel machines out of your code,
providing the base machine separately and overriding parts piecemeal
or attaching transition actions to your code as necessary.
k
be able to do two things:
- redefine (override) machine definitions
- attach actions to definitions separately from their original
definition and without overriding said original definition
Supposing that the former would be implemented such that a
redefinition could reference its previous definition, the latter is
natural; e.g.
%%{
machine ex;
action from_a {
printf("got an A\n");
}
a = ('a');
a = (super | 'A') %from_a;
}%%
Perhaps this is a more moderate proposal to
http://www.complang.org/pipermail/ragel-users/2008-July/001960.html
which would solve some of the same problems. It is also pretty nice
for being able to modularize your Ragel machines out of your code,
providing the base machine separately and overriding parts piecemeal
or attaching transition actions to your code as necessary.
k