[pseudo] A basic implementation of compiling cxx grammar at build time.
authorHaojian Wu <hokein.wu@gmail.com>
Tue, 24 May 2022 18:21:45 +0000 (20:21 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Wed, 25 May 2022 09:26:06 +0000 (11:26 +0200)
commitcd2292ef824591cc34cc299910a3098545c840c7
treee8e2f3f050010e07e3dbb4cd52c6f3bfd50900e5
parent8919447c71ab5940965fc2211c96f1f8b51d5da3
[pseudo] A basic implementation of compiling cxx grammar at build time.

The main idea is to compile the cxx grammar at build time, and construct
the core pieces (Grammar, LRTable) of the pseudoparse based on the compiled
data sources.

This is a tiny implementation, which is good for start:

- defines how the public API should look like;
- integrates the cxx grammar compilation workflow with the cmake system.
- onlynonterminal symbols of the C++ grammar are compiled, anything
  else are still doing the real compilation work at runtime, we can opt-in more
  bits in the future;
- splits the monolithic clangPsuedo library for better layering;

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D125667
14 files changed:
clang-tools-extra/pseudo/CMakeLists.txt
clang-tools-extra/pseudo/gen/CMakeLists.txt [new file with mode: 0644]
clang-tools-extra/pseudo/gen/Main.cpp [new file with mode: 0644]
clang-tools-extra/pseudo/include/CMakeLists.txt [new file with mode: 0644]
clang-tools-extra/pseudo/include/clang-pseudo/cxx/CXX.h [new file with mode: 0644]
clang-tools-extra/pseudo/lib/CMakeLists.txt
clang-tools-extra/pseudo/lib/cxx/CMakeLists.txt [new file with mode: 0644]
clang-tools-extra/pseudo/lib/cxx/CXX.cpp [new file with mode: 0644]
clang-tools-extra/pseudo/lib/grammar/CMakeLists.txt [new file with mode: 0644]
clang-tools-extra/pseudo/lib/grammar/Grammar.cpp [moved from clang-tools-extra/pseudo/lib/Grammar.cpp with 100% similarity]
clang-tools-extra/pseudo/lib/grammar/GrammarBNF.cpp [moved from clang-tools-extra/pseudo/lib/GrammarBNF.cpp with 100% similarity]
clang-tools-extra/pseudo/lib/grammar/LRGraph.cpp [moved from clang-tools-extra/pseudo/lib/LRGraph.cpp with 100% similarity]
clang-tools-extra/pseudo/lib/grammar/LRTable.cpp [moved from clang-tools-extra/pseudo/lib/LRTable.cpp with 100% similarity]
clang-tools-extra/pseudo/lib/grammar/LRTableBuild.cpp [moved from clang-tools-extra/pseudo/lib/LRTableBuild.cpp with 100% similarity]