[ragel-users] more or less solved -- Overfrequent/premature call of 'on-exit-transition' action

Bernie Pallek berniepallek at brytech.com
Fri Sep 11 21:52:19 UTC 2009

Bernie Pallek wrote:
> <cid:part1.03050701.01060104 at brytech.com>Hello,
> We are working on a parser for data blocks, and we've encountered some 
> confusion. An action is being taken more frequently than expected (or 
> prematurely). We've attached a few files that should be helpful (in 
> addition to the original Ragel script). The PNG has been painted on to 
> show where the unexpected action (circled in red) is expected to 
> appear on the graph (end of red arrow).
> ...
Well, it looks like we've overcome our various problems. In the end, the 
most significant consideration was using '%' instead of '@' to trigger 
the "processCompleteMessage" action. It's not ideal, because I'd prefer 
to call the action after having received the expected number of samples, 
as opposed to on transition to the start of the next block. In other 
words, if we receive exactly one block's worth of data, we won't process 
that block until at least one more byte enters the parser. Any 
recommendations on implementing a scheme like that would be appreciated. 
(If you hadn't guessed, I've been only been working with Ragel for about 
24 hours so far, so I apologize if I'm clogging the list with stupid 


- bernie

More information about the ragel-users mailing list