Skip to content

Contribution: Simple C grammar #6

Description

@stevefan1999-personal

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions