[PATCH] D115856: [syntax][pseudo] Introduce the spec C++ grammar.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 20 02:22:05 PST 2022

hokein added inline comments.

Comment at: clang/lib/Tooling/Syntax/Pseudo/cxx.bnf:27
+#   - support annotations (lazy parsing, contextual identifiers)
+#   - empty input should be parsed successfully (special-case it?)
sammccall wrote:
> I think we should spell out what this is, or leave out the FIXME
these FIXMEs probably should not live in the bnf grammar. removed them.

Comment at: clang/lib/Tooling/Syntax/Pseudo/cxx.bnf:30
+# start symbols
+_ := translation-unit
sammccall wrote:
> Is this "default start symbol"?
> I believe we conceptually want to be able to start parsing at other symbols too.
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. 

Comment at: clang/tools/clang-pseudo/ClangPseudo.cpp:1
+//===-- ClangPseudo.cpp - Clang pseudo parser tool ------------------------===//
sammccall wrote:
> Can we use this tool to drive lit tests?
good idea. Refined the tool, now it supports `check-grammar`.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list