[ragel-users] Reading from stream instead of buffer

Ico ragel at zevv.nl
Fri Apr 17 14:24:46 UTC 2009


Hello List,

Tody I discoverd Ragel, and I'm trying to create a small parser for
reading a binary protocol. The databytes are read from a serial port,
and only the parser will know when packets are complete. This makes it
hard to read data into a buffer first, since the underlying code does
not have any protocol knowledge.

Is there a way to make ragel read bytes from a stream, e.g. instead of
using the *p and *pe pointers, I'd like to have a function called by
ragel to receive data from the serial drivere, similar to the ANSI C
getchar() function.

Regards,

Ico

-- 
:wq
^X^Cy^K^X^C^C^C^C




More information about the ragel-users mailing list