Hello folks, I recently found Ragel and have discovered that it is a very pleasant piece of software. That said, I've run into a problem that I was hoping is common and a solution available.
Please see the example code at https://gist.github.com/1661150. Basically, I'd like to parse the following: name:name where the names start and end with an alnum, and can contain any combination of alnum and spaces inside. They could also be blank. My rules for this are: identifier = alnum (space* alnum)*; name = (identifier | zlen) >sName $pName %fName; The names can be separated by a colon and optionally spaces inbetween the names and the colon. My rules for this are: sep = space* ":" space*; main := name sep name; This doesn't work because apparently the space* in identifier and the space* in sep confuse the parser. I end up getting the action fName executed in every space of the name. If I change sep to: sep = ":"; then everything is fine. How do I modify these rules so that the parser does what I intend? _______________________________________________ ragel-users mailing list [email protected] http://www.complang.org/mailman/listinfo/ragel-users
