Hello, I forked this repo and developing another project with it's concept.
https://github.com/Serabass/Sprache-binary
This project works in a similar way but does a different job - It helps to parse binary structures.
A simple example here:
struct RGB {
byte R;
byte G;
byte B;
}
I can write a parser with Sprache's concept:
var parser =
from r in Parse.AnyByte
from g in Parse.AnyByte
from b in Parse.AnyByte
select new RGB { R = r, G = g, B = b };
var memoryStream = new MemoryStream(new byte[] { 255, 0, 0 });
var rgb = parser.Parse(memoryStream);
Assert.Equal(255, rgb.R);
Assert.Equal(0, rgb.G);
Assert.Equal(0, rgb.B);
(I wrote a list of simple binary primitive types)
I'm using the reading of Stream instead of String input.
I'll be glad if you help me in development.
Hello, I forked this repo and developing another project with it's concept.
https://github.com/Serabass/Sprache-binary
This project works in a similar way but does a different job - It helps to parse binary structures.
A simple example here:
I can write a parser with Sprache's concept:
(I wrote a list of simple binary primitive types)
I'm using the reading of Stream instead of String input.
I'll be glad if you help me in development.