cpg
cpg copied to clipboard
Moving from Eclipse CDT to tree-sitter
We want to deprecate Eclipse CDT for various reasons and replace it with tree-sitter.
We will first build up the new frontend in parallel to the old one and then deprecate and replace the old one.
Should also fix
- [ ] #648
- [x] #28
Depends on
- [ ] #688
I just noticed, that tree-sitter is also not resolving everything correctly: https://github.com/tree-sitter/tree-sitter-c/issues/99
Did you also come along similar problems? I'm still not sure, if this is a bug or intended limitation of tree-sitter. If this is a limitation, we need to solve this in the cpg our own.
I just noticed, that tree-sitter is also not resolving everything correctly: tree-sitter/tree-sitter-c#99
Did you also come along similar problems? I'm still not sure, if this is a bug or intended limitation of tree-sitter. If this is a limitation, we need to solve this in the cpg our own.
Just to be aware: we are using https://github.com/tree-sitter/tree-sitter-cpp
This does also apply to the cpp parser.
I am beginning to think that hooking into LLVM / libclang is becoming a more and more viable option. It seems that there is a class called https://clang.llvm.org/doxygen/classclang_1_1ExternalSemaSource.html which can be hooked into to create (missing) variable declarations and types on the fly. It would however mean that we would need some kind of C++ frontend written in C++ that sort of hooks back into the JVM; not sure about this. I will try to get a mini sample running.