[ragel-users] Re: Newbie advice

Adrian Thurston thurs... at cs.queensu.ca
Mon Aug 27 16:22:39 UTC 2007


The easy ways are to use a scanner or to remove the unwanted dashes from
the buffer afterwards (you know they are always going to be there).

But it's also possible to design a state machine that doesn't add to the
buffer when it sees '-', but does so on following characters. See this
thread:

http://groups.google.com/group/ragel-users/browse_thread/thread/c3c9170bfccc0a90/#

Adrian

ddri... at gmail.com wrote:
> Hi Adrian,
> 
> Thanks for the quick reply.  If I add an action to accumlate
> characters from the body of the section that, like this:
> 
>     section = (any_line - marker_line)* $onChar marker_line
> @onSection;
> 
> onChar still seems to get called for part of the marker line, i.e. for
> the '--', but not the final '\n'.  Or is there a better way to do the
> accumulation?
> 
> Thanks,
> 
> -Dave
> 
> 
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "ragel-users" group.
> To post to this group, send email to ragel-users at googlegroups.com
> To unsubscribe from this group, send email to ragel-users-unsubscribe at googlegroups.com
> For more options, visit this group at http://groups.google.com/group/ragel-users?hl=en
> -~----------~----~----~----~------~----~------~--~---
> 
> 

-------------- 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/20070827/e4de095f/attachment-0001.sig>


More information about the ragel-users mailing list