cpg icon indicating copy to clipboard operation
cpg copied to clipboard

Moving from Eclipse CDT to tree-sitter

Open oxisto opened this issue 3 years ago • 4 comments

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

oxisto avatar Nov 10 '21 09:11 oxisto

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.

peckto avatar Apr 22 '22 07:04 peckto

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

oxisto avatar Apr 22 '22 14:04 oxisto

This does also apply to the cpp parser.

peckto avatar Apr 22 '22 17:04 peckto

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.

oxisto avatar Apr 23 '22 10:04 oxisto