[ragel-users] State Chart Finishing Actions?

Adrian Thurston thurston at complang.org
Fri Mar 6 03:46:49 UTC 2009


You should use any @0, or use @(blink,1) for the SM events. The 
priorities need to have the same name. Without a name the name of the 
machine "blinks" (with an s) is used.

Also, this will only work if the SM events are one character. I don't 
see their definitions so I'm not sure if that's the problem.

-Adrian

Bob Paddock wrote:
> On Mon, Apr 28, 2008 at 7:53 PM, Adrian Thurston <thurston at cs.queensu.ca> wrote:
>> Hi Bob, you can use priorities to do this.
>>
>> (
>>   'a' |
>>   'b' |
>>   'c' |
>>   ...
>> ) @1 |
>> (
>>   any @0
>> )
>>
>> Though there really should be a guarded union operator that does this.
> 
> I'm not getting that to work.  Here is a simplified example,
> (with several non-working tries commented out):
> 
>    blinks = (
>        start: (
>                SM2008_MODEL_EVENT -> SM2008_MODEL |
>                SM2009_MODEL_EVENT -> SM2009_MODEL
>               )@1 |
>               (
> #               any @(blink, 0)
>                any $(blink, 0)
> #               any @0
>               )
> #              )@blink
> 
> 
> If I get any character besides 2008 or 2009 events I want to call the
> action 'blink'.
> 
> I am never seeing blink called.  Machine always returns -1 on
> non-2008/2009 events (blink never returns).
> 
> What is the correct syntax here?
> 
>>>     I think what you want instead of any* is [^>].
>>>
>>>
>>> [^>] worked fine when I have a few states.
>>> Is there a better way to do it if you have say
>>> forty states that would be valid?
> 
> _______________________________________________
> ragel-users mailing list
> ragel-users at complang.org
> http://www.complang.org/mailman/listinfo/ragel-users




More information about the ragel-users mailing list