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 | ||
---|---|---|
12 | translation-unit appears to be non-nullable in the grammar here | |
13 | nit: adjusted | |
27 | I think we should spell out what this is, or leave out the FIXME | |
28 | 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. | |
30 | Is this "default start symbol"? | |
33 | 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) | |
44 | nit: gram.basic | |
clang/tools/clang-pseudo/ClangPseudo.cpp | ||
1 | Can we use this tool to drive lit tests? | |
41 | nit: parse -> parsed | |
42 | do you want to dump the grammar? (Behind a dump-grammar subcommand) | |
43 | Diagnostics.empty() ? 0 : 2? |
add new line to eof
clang/lib/Tooling/Syntax/Pseudo/cxx.bnf | ||
---|---|---|
27 | these FIXMEs probably should not live in the bnf grammar. removed them. | |
30 | 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 | ||
1 | good idea. Refined the tool, now it supports check-grammar. |
translation-unit appears to be non-nullable in the grammar here