3 ms·
It looks ok but I think you would need to try and implement something in it to see if there are any problems. I was a bit wary of the programmatic parts at firs
by richardjam73 4y ago
It looks ok but I think you would need to try and implement something in it to see if there are any problems. I was a bit wary of the programmatic parts at first but I see where they can be used to cut down on repitition in the grammar. I thought that the functions should be more different than the rules/identifiers for instance.
part = @bind(number, @uint(8,~)) & @uint(16,~) & number
Because if you are writing the grammar for a language you may have similar constructs.
- kstenerud 4y agoHmm yeah, I can see how visual differentiation of the functions from symbols and macros could help readability. The base grammar minus macros and functions is mostly like any other BNF, and so would have its strengths and weaknesses when it comes to describing a language vs a format. The main inspiration for this was because I couldn't describe CTE and CBE (whose grammars are listed above). I also tried it out describing IPV4 (also listed above). I'll probably try describing something like protobufs or PNG or something like that to see how well it fares, but for now I'm interested in peoples immediate reaction to it in case there are glaring problems.