Discussion:
[ragel-users] How to do substring match in ragel?
dinesh rtp
2013-10-15 17:32:25 UTC
Permalink
Please excuse if this is question is direct, I am new to ragel and looking for directions so I can work on my own. Given a set of strings (say 15), how to build a state machine that given a string spits out if it is a substring or not? It would be really helpful if I can get pointed at the right direction.
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.complang.org/pipermail/ragel-users/attachments/20131015/4b595bd9/attachment.html>
RU
2013-10-15 17:54:13 UTC
Permalink
Obviously, you need to read the documentation. Then there is the example directory. I would
recommend to start with the simple ones and augment them with additional actions, just to see
the effect and to learn when they are called. You must really know what an "entering",
"finishing", "all transition", or "leaving" action does and when these actions happen.

At some point you must decide whether you want a state machine or a scanner for your project.
The state machine does not do something like a longest match. You will find out soon what makes
sense in which situation.

Loading...