You came to the right place. This is what ragel was designed for. -Adrian ------Original Message------ From: Karel Sedláček Sender: ragel-users-boun...@complang.org To: ragel-users ReplyTo: ragel-users Subject: [ragel-users] Incremental parsing with ragel Sent: Nov 10, 2012 11:02 AM
Ideally, I'd like to be able to write a parser that fits this sort of a prototype: /* feed data in in blocks and let ragel call the actions to deal with it */ void parse_x(parser_t *p, void *buf, size_t buf_len); /* now we need an OOB way to tell ragel about real EOF */ void parse_x_eof(parser_t *p); The need here is that all of the parsing work I am doing deals with non-blocking I/O, and it is not at all feasible to buffer "all" of the protocol data and then feed it to ragel. Neither is it acceptible to do something like the getchar() loop I have seen elsewhere. Is it possible in Ragel for the parser to encounter a EOB (end of buffer) state and serialize itself somewhere to be re-entered with more data later? k _______________________________________________ ragel-users mailing list ragel-users@complang.org http://www.complang.org/mailman/listinfo/ragel-users _______________________________________________ ragel-users mailing list ragel-users@complang.org http://www.complang.org/mailman/listinfo/ragel-users