Also, add a dummy clang-pseudo tool (right now it accepts and parses the
grammar file).
Details
- Reviewers
sammccall - Commits
- rGe1db505b42f4: [syntax][pseudo] Introduce the C++ spec grammar.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| clang/lib/Tooling/Syntax/Pseudo/cxx.bnf | ||
|---|---|---|
| 13 | translation-unit appears to be non-nullable in the grammar here | |
| 14 | nit: adjusted | |
| 28 | I think we should spell out what this is, or leave out the FIXME | |
| 29 | This probably isn't a FIXME for the grammar right? If we're going with non-nullable rules, having the *parser* special-case _ as nullable seems more sensible. | |
| 31 | Is this "default start symbol"? | |
| 34 | I'd suggest dropping the A.1 part, as it's version-specific (e.g. gram.basic is currently A.4 at https://eel.is/c++draft/gram, which is a pretty common reference) | |
| 45 | nit: gram.basic | |
| clang/tools/clang-pseudo/ClangPseudo.cpp | ||
| 2 | Can we use this tool to drive lit tests? | |
| 42 | nit: parse -> parsed | |
| 43 | do you want to dump the grammar? (Behind a dump-grammar subcommand) | |
| 44 | Diagnostics.empty() ? 0 : 2? | |
add new line to eof
| clang/lib/Tooling/Syntax/Pseudo/cxx.bnf | ||
|---|---|---|
| 28 | these FIXMEs probably should not live in the bnf grammar. removed them. | |
| 31 | Technically, _ is the augmented symbol with the *real* start symbols coming on the right hand side -- this is a technique to make LR parsing life easier. | |
| clang/tools/clang-pseudo/ClangPseudo.cpp | ||
| 2 | good idea. Refined the tool, now it supports check-grammar. | |
translation-unit appears to be non-nullable in the grammar here