C++ code indexing and visualization

The project has the ability to handle overloading resolutions and partially do template instantiation.

Demos:

Source code is in release-1.0 branch of vczh-libraries/Document

Overloading Resolution
Instantiation
Click and Jump
Jump with Type Inferencing

C++ parser (2.0)

GLR parser generator vczh-libraries/VlppParser2 and completed a demo of C++ parser (handling most of C++20 syntax)

Story of the project

The first version of vczh-libraries/Document was created to parse, analyse and index the source code of GacUI, as well as rendering comments as document.

Unfortunately after upgrading the project to use Visual Studio 2022, I found that the new C++ compiler has a problem dealing with decltype of captured symbols inside nested lambda expressions, which makes my whole unit test unable to compile. Bugs has been submitted to the VC++ team but not all of them are fixed at the moment.

I realized that the way I do the project is too fancy, so in the next version, I decided to rewrite the whole project in a completely different approach, which is parsing the C++ source code first, and then resolve symbols.

We know that a typical C++ compiler needs to resolve symbols during parsing in order to handle ambiguities, but my project is for indexing code and rendering documents, I don't have to resolve symbols 100% precisely, if I see something too complex to handle I could link the symbol to multiple candidates.

So I decided to allow ambiguity during parsing, if some interpretations are proven to be incorrect, they can be deleted later. More importantly, when parsing source code of a template, decisions are not always possible to be made before instantiating it. Ambiguity is unavoidable.

For example, when the compiler see a statement like a<b>c;, it would create an AST containing all possible interpretation of the code: binary expression or variable definition. The core feature is to limit the ambiguity in the deepest possible AST node, the outcome is that, you only get one AST for the file, but when you navigate to this statement, you will see it has two interpretations.

I created another project to generate a parser in C++ from a syntax that allow almost any possible kind of ambiguity: vczh-libraries/VlppParser2.