Skip to content
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

Integrate the grammar into the reference #221

Open
alercah opened this issue Jan 31, 2018 · 5 comments
Open

Integrate the grammar into the reference #221

alercah opened this issue Jan 31, 2018 · 5 comments
Labels
A-grammar Area: Syntax and parsing New Content Missing features or aspects of language not currently documented.

Comments

@alercah
Copy link
Contributor

alercah commented Jan 31, 2018

The grammar reference at https://doc.rust-lang.org/grammar.html should be integrated into the reference in some fashion, possibly as a separate appendix or possibly just integrated in with individual sections.

@alercah alercah added the New Content Missing features or aspects of language not currently documented. label Jan 31, 2018
@matthewjasper
Copy link
Contributor

see also: #84

@brauliobz
Copy link
Contributor

brauliobz commented Mar 10, 2018

I've made a script to join all grammar snippets:

https://github.com/brauliobz/rust-reference/blob/grammar_join/join_grammar_snippets.py

The result is something like this:

https://brauliobz.github.io/rust-reference/grammar.html

I was expecting to have the finished grammar before, but I can make a PR if having the incomplete appendix is not a problem.

@willy610
Copy link

willy610 commented Apr 1, 2018

@brauliobz This is looking good (the .html output) .
Please tell a novis like me where to find the input to your script ..../join_grammer_snippets.py
Something versioned in the compiler source?
I'm totally into producing railroad graphs as an complement to the .html BNF
This is fun!!

@brauliobz
Copy link
Contributor

@willy610 the input is the reference, i.e., all grammar snipets in the .md source files in the src dir. So they're already formatted, which will make things more difficult to you, since you would have to parse the markdown.

The compiler has a grammar, but it isn't optimized for human consumption, since it must adhere to the parser generator mechanics. There's also this one and this one and others I'm unaware of.

@willy610
Copy link

willy610 commented Apr 2, 2018 via email

@ehuss ehuss added the A-grammar Area: Syntax and parsing label Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-grammar Area: Syntax and parsing New Content Missing features or aspects of language not currently documented.
Projects
None yet
Development

No branches or pull requests

5 participants