I found this project to be pretty interesting, so I tried to port the C99 grammar based on https://slebok.github.io/zoo/c/c99/iso-9899-tc3/extracted/index.html with some modifications. It should parse most of the C grammar correctly, but I'm still looking for edge cases especially for expression parsing (the original C99 grammar uses Precedence Climbing rather than having a precedence table, and some grammar rules need to have some of the layered expression in between, and the AST is a little bit messy)
It is available here: https://github.com/stevefan1999-personal/rustemo-play. Hope it can help the project out by providing a concrete use case so we can improve the ergonomics somehow.
(Also I have to use stacker::maybe_grow because otherwise it will print stack overflow error on debug build)
I found this project to be pretty interesting, so I tried to port the C99 grammar based on https://slebok.github.io/zoo/c/c99/iso-9899-tc3/extracted/index.html with some modifications. It should parse most of the C grammar correctly, but I'm still looking for edge cases especially for expression parsing (the original C99 grammar uses Precedence Climbing rather than having a precedence table, and some grammar rules need to have some of the layered expression in between, and the AST is a little bit messy)
It is available here: https://github.com/stevefan1999-personal/rustemo-play. Hope it can help the project out by providing a concrete use case so we can improve the ergonomics somehow.
(Also I have to use
stacker::maybe_growbecause otherwise it will print stack overflow error on debug build)