[ragel] Binary data and bits
sothy.e98 at gmail.com
Sun Oct 1 06:52:14 UTC 2017
Thanks again Adrain. In GTP protocol, I have some data (array of
Information Element (IE)). Each IE has around of 4 bytes. The data in the
first byte is like that.
In this case, I should use all times mask and shift the bits.
On Sat, Sep 30, 2017 at 5:38 PM, Adrian Thurston <thurston at colm.net> wrote:
> Looks like you accept all bytes so you don't really need ragel for that.
> Just need to mask and shift the bits.
> Adrian D. Thurston
> Chief Scientist
> Colm Networks
> -------- Original message --------
> From: sothy shan <sothy.e98 at gmail.com>
> Date: 2017-09-30 6:43 AM (GMT-05:00)
> To: ragel at colm.net
> Subject: Re: [ragel] Binary data and bits
> Thanks Adrain,
> I am new to Ragel. I have one question.
> One BYTE information: 010 1 1 000
> 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.
> How to write grammar for parsing this data?
> Thanks for your help.
> Best regards
> On Fri, Sep 29, 2017 at 10:08 PM, Adrian Thurston <thurston at colm.net>
>> Hi Sothy, you need to specify the grammar at the byte level. You can
>> union bit patterns together, however.
>> On 2017-09-27 15:35, sothy shan wrote:
>> I need to parse 4 bytes of data and some bits of data has valid
>> How can I go with Ragel?
>> I am going to use Ragel with C++.
>> Best regards
>> ragel mailing listragel at colm.nethttp://www.colm.net/cgi-bin/mailman/listinfo/ragel
>> ragel mailing list
>> ragel at colm.net
> ragel mailing list
> ragel at colm.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ragel-users