[ragel-users] Re: Bug or feature?
Carlos Antunes
cmantu... at gmail.com
Fri Jul 20 04:46:11 UTC 2007
Adrian,
Yes, that what I was mentioning. However, that was not the behavior of
old_enter, was it? Old_enter still needed something to process first,
no?
In any case, I was trying to get to something. Let me illustrate:
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
This means that, from a semantic point of view,
machine_c >action_b <=> %action_b machine_c
So, why not actually use something like:
machine_d = %entering_c machine_c?
After all, because the start and final states are collapsed, they are
essential the same and this sameness is reflected in the "same" symbol
to represent both. The only change would be to accept two %% in
sequence (one final, the other start), for consistency purposes. For
example:
machine_a = expr1 %final_a
machine_b = %start_b expr2
machine_c = machine_a machine_b <=> machine_c = expr1 ( %final_a
%start_b ) expr2
The bottom line is that, because the start and final states are
indistinguishable, the symbols that represents transition actions into
them should be too. The syntax just needs to be slightly adjusted to
reflect this and all will be good.
Thanks!
Carlos
On 7/19/07, Adrian Thurston <thurs... at cs.queensu.ca> wrote:
> Hi Carlos,
>
> If I understand you correctly, this happens automatically. When you
> concatenation two machines the start state of the second machine is
> effectively copied into the final states of the first machine by way of
> an epsilon transition.
>
> Adrian
>
> Carlos Antunes wrote:
> > Question: would you be able to associate the "old_enter" action with
> > the final state's OUT transition from the previous machine? This would
> > be equivalent to associating "old_enter" action with the IN transition
> > of the current machine.
>
>
>
--
"We hold [...] that all men are created equal; that they are
endowed [...] with certain inalienable rights; that among
these are life, liberty, and the pursuit of happiness"
-- Thomas Jefferson
More information about the ragel-users
mailing list