[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2022-02-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/Tooling/Syntax/Pseudo/CMakeLists.txt:3 + +add_clang_library(clangSyntaxPseudo + Grammar.cpp thakis wrote: > (i think the usual name would be "clangToolingSyntaxPseudo") (the name is too verbose, and we have a

[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2022-02-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In D114790#3293783 , @thakis wrote: > In D114790#3293777 , @sammccall > wrote: > >> In D114790#3293764 , @thakis wrote: >> >>> Is there any

[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2022-02-03 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment. In D114790#3293777 , @sammccall wrote: > In D114790#3293764 , @thakis wrote: > >> Is there any background information anywhere what this pseudo parser is? > > Design doc: >

[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2022-02-03 Thread Nico Weber via Phabricator via cfe-commits
thakis added inline comments. Comment at: clang/unittests/Tooling/Syntax/Pseudo/CMakeLists.txt:6 +add_clang_unittest(ClangPseudoTests + GrammarTests.cpp +) ``` thakis@thakis:~/src/llvm-project$ ls clang/unittests/**/*Test.cpp | wc -l 127

[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2022-02-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In D114790#3293764 , @thakis wrote: > Is there any background information anywhere what this pseudo parser is? Design doc: https://docs.google.com/document/d/1eGkTOsFja63wsv8v0vd5JdoTonj-NlN3ujGF0T7xDbM/edit RFC:

[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2022-02-03 Thread Nico Weber via Phabricator via cfe-commits
thakis added inline comments. Comment at: clang/lib/Tooling/Syntax/Pseudo/CMakeLists.txt:3 + +add_clang_library(clangSyntaxPseudo + Grammar.cpp (i think the usual name would be "clangToolingSyntaxPseudo") Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2022-02-03 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment. Is there any background information anywhere what this pseudo parser is? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114790/new/ https://reviews.llvm.org/D114790 ___

[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2022-02-03 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG20e05b9f0ebe: [syntax][pseudo] Add Grammar for the clang pseudo-parser (authored by hokein). Changed prior to commit:

[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2022-02-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. Comment at: clang/include/clang/Tooling/Syntax/Pseudo/Grammar.h:85 + static constexpr unsigned SizeBits = 4; + static_assert(SizeBits + SymbolBits <= 16, +"Must be able to store symbol ID + size

[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2022-02-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/include/clang/Tooling/Syntax/Pseudo/Grammar.h:85 + static constexpr unsigned SizeBits = 4; + static_assert(SizeBits + SymbolBits <= 16, +"Must be able to store symbol ID + size efficiently");

[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2022-02-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 405550. hokein marked 12 inline comments as done. hokein added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114790/new/ https://reviews.llvm.org/D114790 Files:

[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2022-02-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: clang/include/clang/Tooling/Syntax/Pseudo/Grammar.h:85 + static constexpr unsigned SizeBits = 4; + static_assert(SizeBits + SymbolBits <= 16, +

[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2022-01-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/include/clang/Tooling/Syntax/Pseudo/Grammar.h:52 +// Terminal IDs correspond to the clang TokenKind enum. +using SymbolID = uint16_t; +// SymbolID is only 12 bits wide. sammccall wrote: > If we want strong types,

[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2022-01-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 401175. hokein marked 8 inline comments as done. hokein added a comment. refine the patch: - address comments - remove unneeded code - move the BNF-grammar parsing code to a dedicate class, rather in Grammar. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2021-12-21 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang/include/clang/Tooling/Syntax/Pseudo/Grammar.h:52 +// Terminal IDs correspond to the clang TokenKind enum. +using SymbolID = uint16_t; +// SymbolID is only 12 bits wide. If we want strong types, we could use

[PATCH] D114790: [syntax][pseudo] Add grammar facilities for the pseudo-parser

2021-11-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: mgrang, mgorny. hokein requested review of this revision. Herald added a project: clang. This patch introduces basic structures for the grammar, which is used to build a grammar-based parser. As the first