<div dir="ltr"><div><div><div><div><div><div><div>Thanks Adrain,<br><br></div>I am new to Ragel. I have one question. <br></div>One BYTE information: 010 1 1 000<br></div>I need to take firrst three bits into one int, other two bits are two boolean values and other three are together for one int.<br><br></div>How to write grammar for parsing this data?<br><br></div>Thanks for your help.<br><br></div>Best regards<br></div>Sothy<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 29, 2017 at 10:08 PM, Adrian Thurston <span dir="ltr"><<a href="mailto:thurston@colm.net" target="_blank">thurston@colm.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div style="font-size:14pt;font-family:Verdana,Geneva,sans-serif">
<p>Hi Sothy, you need to specify the grammar at the byte level. You can union bit patterns together, however.</p><div><div class="h5">
<p>On 2017-09-27 15:35, sothy shan wrote:</p>
</div></div><blockquote type="cite" style="padding-left:5px;border-left:#1010ff 2px solid;margin-left:5px"><div><div class="h5">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>Hi,</div>
I need to parse 4 bytes of data and some bits of data has valid information.</div>
How can I go with Ragel?</div>
I am going to use Ragel with C++.<br><br></div>
Best regards</div>
Sothy<br><br></div>
<br>
</div></div><pre>______________________________<wbr>_________________
ragel mailing list
<a href="mailto:ragel@colm.net" target="_blank">ragel@colm.net</a>
<a href="http://www.colm.net/cgi-bin/mailman/listinfo/ragel" target="_blank">http://www.colm.net/cgi-bin/<wbr>mailman/listinfo/ragel</a>
</pre>
</blockquote>
</div>
<br>______________________________<wbr>_________________<br>
ragel mailing list<br>
<a href="mailto:ragel@colm.net">ragel@colm.net</a><br>
<a href="http://www.colm.net/cgi-bin/mailman/listinfo/ragel" rel="noreferrer" target="_blank">http://www.colm.net/cgi-bin/<wbr>mailman/listinfo/ragel</a><br>
<br></blockquote></div><br></div>