Closed mingodad closed 1 year ago
See also this project https://github.com/bleibig/rust-grammar/issues/16 that has a grammar with 0 conflicts comparing with this one that has:
cat rust.y > .gen/.rust.y
cpp -P rust_expr.y.h >> .gen/.rust.y
cpp -P rust_tts.y.h >> .gen/.rust.y
[BISON] .gen/rust.tab.cpp
.gen/.rust.y: warning: 748 shift/reduce conflicts [-Wconflicts-sr]
.gen/.rust.y: warning: 581 reduce/reduce conflicts [-Wconflicts-rr]
.gen/.rust.y:705.4-25: warning: rule useless in parser due to conflicts [-Wother]
: '{' block_contents '}'
^^^^^^^^^^^^^^^^^^^^^^
The BNF grammar in the mrustc repo is OLD code, not maintained or used at all. Should probably just delete it.
I'm developing a Yacc/Lex
compatible online editor/tester and I have there the grammar from https://github.com/bleibig/rust-grammar.git there that can parse several rust
code (it need the >>
in generic parameters to have a space > >
till a fix come along).
It can be seen here https://mingodad.github.io/parsertl-playground/playground/ (select Rust parser
then click Parse
to see a parser tree for the content in Input source
editor).
I think it can help debug/develop/test/document grammars/parsers !
Any feedback is welcome !
Using some online tools like https://www.bottlecaps.de/rr/ui and https://www.bottlecaps.de/convert/ we can have a nice navigable railroad diagram.
Copy and paste the
EBNF
shown bellow on https://www.bottlecaps.de/rr/ui on the tabEdit Grammar
the click on the tabView Diagram
to see/download a navigable railroad diagram.