-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert FlexT descriptions into Kaitai ones #292
Comments
Thanks, that's another really interesting gem that I had no idea about! Looks like the project is kind of abandoned, though :(
Hmm, actually I recall doing a pretty convinicing implementation of sqlite... Have I forgot to commit it?..
Yeah, I've got your e-mail, thanks! Confirming his intention to make it available under MIT-like license as well. AFAIU, Alexei used Coco/R for grammar description, which technically can generate parsers for Python or Ruby, so probably it won't be that hard to create a script that would do the conversion. |
/me facepalms |
@GreyCat, I have already found, that it is a CoCo/R grammar, but there is some issues with the python generator / the grammar file itself. The generator says that the grammar file is invalid. In fact it looks like it is really invalid for vanilla CoCo/R, for example it uses I have replaced these stuff with valid CoCo/R, but it still fails in another place, I'm not very familiar with coco/R , but another grammar with the same tokens works fine. Maybe there is still something wrong in this grammar, but I am not sure untill I finished fixing the generator to be able to run the test suite. |
Well, may be manual conversion would be more feasible in this case. Probably we should do a list of formats available there which are not yet available for KS? Quite a few of these formats are available in our repo already. |
The script in the first post does create the list. There are too many formats we don't have, so I guess we need a tool. But a manual conversion of the grammar to some alive parser like |
Failed to make CoCoPy to compile that grammar. (CoCo/R is LL(1), but the thing seems to use some extensions beyond LL(1) and some additional, I haven't found any description or an implementation of CoCo/R using these extensions). Converted the grammar to the parglare one (parglare claims to be the fastest parser generator (but we know that CoCoPy is the fastest because it generates the code and because it is LL(1)) for python parglare generates parsers for LR and GLR, GLR, which is more powerful). The grammar compiles but doesn't work even in GLR mode (says that "\n" is expected) :(. Damn slow even in LR mode. Need future debugging. |
Original link is broken (when you click a file type), here's a new one- |
Thanks, @NotWearingPants, for letting us know. Thanks, @generalmimon, for fixing. @NotWearingPants, I have fixed some bugs within the download script too. If you want to work on the flext converter, https://github.com/KOLANICH-specs/kaitai_struct_formats/tree/FlexT/flext may be helpful. It is a temporary branch, should not be PRed as it is. Just a scratch space for my convenience. |
I've found the webpage with one more language to create binary parsers. It also has own library of descriptions. Some of them are missing in kaitai_struct_formats, for example SQLite.
http://geos0.icc.ru/scripts/WWWBinV.dll/Cat
In a e-mail conversation Alexei Hmelnov stated that a one may assume that all the descriptions are under MIT license and that he is going to add a license to the site when he have time.
The script to download the formats from the site
He also have provided me with a formal grammar of his language.
The text was updated successfully, but these errors were encountered: