[pseudo] Implement the GLR parsing algorithm.
authorSam McCall <sam.mccall@gmail.com>
Thu, 28 Apr 2022 08:21:51 +0000 (10:21 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Tue, 3 May 2022 13:42:07 +0000 (15:42 +0200)
commiteac22d0754f70df10ea0eb6f59cbd1ef012ab5a4
treee087e575b39d0dee617f9db08b0f95092d8fdc3a
parentca0b41665978d5efd8482188a0541342cb298031
[pseudo] Implement the GLR parsing algorithm.

This patch implements a standard GLR parsing algorithm, the
core piece of the pseudoparser.

- it parses preprocessed C++ code, currently it supports correct code
  only and parse them as a translation-unit;
- it produces a forest which stores all possible trees in an efficient
  manner (only a single node being build for per (SymbolID, Token Range));
  no disambiguation yet;

Differential Revision: https://reviews.llvm.org/D121150
clang-tools-extra/pseudo/include/clang-pseudo/Forest.h
clang-tools-extra/pseudo/include/clang-pseudo/GLR.h [new file with mode: 0644]
clang-tools-extra/pseudo/lib/CMakeLists.txt
clang-tools-extra/pseudo/lib/GLR.cpp [new file with mode: 0644]
clang-tools-extra/pseudo/test/glr.cpp [new file with mode: 0644]
clang-tools-extra/pseudo/tool/ClangPseudo.cpp
clang-tools-extra/pseudo/unittests/CMakeLists.txt
clang-tools-extra/pseudo/unittests/GLRTest.cpp [new file with mode: 0644]