Hi. I'm new to ragel and currently exploring its features. I'm working on some applications using microcontrollers which have very limited resources. Microcontrollers communicate with each other with radio. I'm using ragel to parse radio protocol. So here is my questions:<br>
<br>1. Main part of my application is infinite loop, which is waiting for input, parses it with ragel-generated code and do some work. So I don't have EOF-thing at all. I don't use any EOF actions(at least explicitly). But generated code still contains some EOF-stuff which uses eof variable(thus I have to declare it). Documentation states: "If EOF actions are used then the eof variable is required."(so if I don't use EOF actions it shouldn't be required) I think I'm missing something. Maybe I have to state explicitly somewhere in .rl file that EOF is senseless in my case. Here is my dummy-playground-example for PC <a href="http://gist.github.com/239028">http://gist.github.com/239028</a><br>
<br>2. Ragel assumes that data which have to be processed is between p and pe pointers. Can this be customized? Here is what I want. I have ring-buffer which fills in interrupt routines. I have interface function for this ring-buffer, which returns data from this buffer byte by byte ( int cyw_tryread(uint8_t* ptr) ). If there is some valid data in buffer it writes it to (*ptr) and returns 1, otherwise 0. I want ragel to use this function as source of data instead of walking through p pointer. It seems that all I need to do for this is replace<br>
> if ( ++p != pe )<br>> goto _resume;<br>with<br>> if ( cyw_tryread(p))<br>> goto _resume;<br>pe pointer is useless here. So can I customize this in ragel without patching generated code(patching generated code is not very good thing to do...)<br>
<br>3. Can I embed C checks within machine definition statement? e.g. if I want machine that matches any character, that have nonzero bit number 2 (xxxxx1xx). So for this characters (ch & 4) is true. Is there a way to define such machine?<br>
<br>Any tips and explanations would be very much appreciated.<br>__<br>Grygoriy Fuchedzhy<br><br>