[ragel-users] Re: Bug or feature?
Adrian Thurston
thurs... at cs.queensu.ca
Fri Jul 20 06:03:58 UTC 2007
Carlos Antunes wrote:
> machine_a = machine_b %action_b machine_c
>
> Now, this is semantically equivalent to (assuming that ">" is really
> associated with the start state:
>
> machine_a = machine_b machine_c >action_b
They are not quite equivalent. Consider the case of machine_c accepting
the zero-length word (start state is final). Then action_b will be a
pending out action of machine_a.
Note however that the first form above is equivalent to the second form
under the old semantics of >.
One thing I don't like about the syntax you propose is that it creates
an ambiguity in the ragel language itself. When you parse % is it
associated with the tree on the left or the tree on the right? Right now
all embedding operators are currently of this form:
<expr> <op> <action>
and this syntax changes that.
Also note that you can achieve the same thing using the existing
language by putting "" in front of %. Like this:
machine_a = machine_b ( ""%action_b machine_c );
So that brings up an interesting point. The line directly above is
another way to emulate the old semantics of >.
-Adrian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20070720/64309d04/attachment-0001.sig>
More information about the ragel-users
mailing list