2

Is there any ability to lexemize binary file formats (e.g. jpeg images) with Fslex (with no readability lacks) or i should write my own lexer/use something like fparsec?

Kovalev
  • 31
  • 2
  • If you can write the lexing rules you can do it – Rune FS Sep 22 '11 at 07:10
  • 4
    hi - IMHO you don't need anything as sophisticated as fslex/fsyacc or fsparsec to read in a jpeg file. Those file formats were made to be easily read/write/process by programms, have fixed formats, headers, etc. - it's straight forward to read them in and you sureley don't need generated tokens or abstract syntax trees for them – Random Dev Sep 22 '11 at 07:12
  • I agree with Carsten. You can read about binary parsing here: http://langexplr.blogspot.com/2008/10/using-f-computation-expressions-to-read.html also Don Syme wrote about parser combinators in his Expert F#... – Dmitry Sep 22 '11 at 07:23
  • actually it's not a real task to read jpegs. just interesting – Kovalev Sep 22 '11 at 07:46
  • 1
    Have a look at https://github.com/devshorts/ParsecClone. It's a parser combinators library supporting binary parsing. – Eugene Fotin Nov 10 '13 at 22:17

0 Answers0