Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Recreate the AntlrV2 compiler and runtime, that proved useless since the AntlrV2 code itself had licensing problems (see the comment by Terrence Parr above), and we don't know what the improvements to this compiler were done in the "org.netbeans.modules.cnd.antlr" compiler.
  2. Migrate the AntlrV2 compiler and runtime to the more modern Antlr V4 runtime. This path was explored and promised interesting performance improvements (see https://github.com/vieiro/cnd.nextapt ) but it would require difficult mainteinance of the grammars, and a refactoring of many modules in the CND cluster to support the new runtime. Adapting the Antlr V4 runtime to look like the Antlr V2 runtime with minimum impact could be difficult, because Antlr V4 uses either Parser Listeners or Parse Tree Visitors to build the AST, which is a major difference with Antlr V3 (and V2) ASTs.
  3. Use the clank library (https://github.com/java-port/clank) . This library is a pure Java port of LLVM39 that was presented in the "2017 EuroLLVM Developers' Meeting" and was in the process of being used in NetBeans 8.2, but was not clearly adopted. An analysis of the project showed the following issues:
    1. Licensing: the project had no clear license. In April, 2021 the Apache PMC contacted the authors and they clearly stated that the library was covered by the LLVM license (see https://github.com/java-port/clank/blob/master/modules/org.clang.analysis/src/org/clang/analysis/analyses/AnalysisClangGlobals.java) and some other parts had different licenses.
    2. Build instructions: There're no clear build instructions in the project.
    3. Support for newest LLVM versions: We don't know how to port the project to a more modern version of LLVM.
  4. Use the "libclang" https://clang.llvm.org/doxygen/group__CINDEX.html library inside NetBeans. By creating some JNI wrappers that could add support to syntax highlighting, code completion and more. This experiment is at https://github.com/vieiro/netbeans/tree/cnd-libclang-12.4/cnd/cnd.clang . Some analysis showed that "libclang" is not the proper approach if one wants "full control over the Clang AST" (https://clang.llvm.org/docs/Tooling.html), so this path was discarded.
  5. Use "sulong" in GraalVM (https://github.com/oracle/graal/tree/master/sulong) that can execute clang. This was proposed in the Apache NetBeans mailing list.
  6. Reuse some of the modules in the "cnd" cluster to add support for Makefile based projects (and more), and integrate them in the "cpplite" branch, that uses LSP servers (such as clangd) to add support for code completion, syntax highlighting and more. This is a work in progress. An initial version is athttps://github.com/vieiro/netbeans/tree/cnd-projectssmall and the list of modules to recover from the CND cluster is at https://github.com/vieiro/netbeans/blob/b9bb4c36bbcd759578ac789e81234024fb8058f557d9c16bcf5532c6c9c9a75f9a69ad1895f10261/nbbuild/cluster.properties#L1082properties#L1071 

Issue #2: Two different parsers (C++ model implementations) in NetBeans 8.2 and missing tests

...

The 4th and 5th donations of the NetBeans 8.2 source by Oracle to the ASF contain the "cnd" modulecluster, and presented some issues that have either been resolved or must still be addressed by the Apache NetBeans Team.

Several workarounds have been proposed and explored to circumvent these issues, with different complexity and mainteinance costs. A proposed final plan will be discussed in another document and linked here

See cnd integration proposal: cnd-small for a proposal to integrate some of the functionalities of cnd in Apache NetBeans.