Skip to content

feat(cpp): add C/C++ detection engine, language support, and register in LanguageSupporter#409

Open
Divyateja2709 wants to merge 17 commits into
cbomkit:mainfrom
Divyateja2709:pr8
Open

feat(cpp): add C/C++ detection engine, language support, and register in LanguageSupporter#409
Divyateja2709 wants to merge 17 commits into
cbomkit:mainfrom
Divyateja2709:pr8

Conversation

@Divyateja2709
Copy link
Copy Markdown

Description:
This PR completes the engine interface layer for C/C++. It depends on PR 1C-1 being merged first since CppLanguageSupport wires together all three classes from that PR.
Files added in engine/src/main/java/com/ibm/engine/language/cpp/:

  • CppDetectionEngine.java — implements IDetectionEngine<CppTree, CppSymbol>. Walks CppBlockTree statements, matches CppMethodInvocationTree nodes against detection rules, resolves argument values from literals/identifiers/member access expressions, and tracks assigned variable symbols.
  • CppLanguageSupport.java — implements ILanguageSupport<CppCheck, CppTree, CppSymbol, CppScanContext>. Ties everything together — creates DetectionExecutive, CppDetectionEngine, and CppBaseMethodVisitor instances. This is the top-level factory the rest of the plugin uses.

One file modified:

engine/src/main/java/com/ibm/engine/language/LanguageSupporter.java — adds cppLanguageSupporter() static method returning a new CppLanguageSupport(), same pattern as csharpLanguageSupporter().

Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
Signed-off-by: Divyateja Indrakanti <indrakantidivyateja@gmail.com>
@Divyateja2709 Divyateja2709 requested a review from a team as a code owner May 10, 2026 03:29
@san-zrl
Copy link
Copy Markdown
Contributor

san-zrl commented May 20, 2026

Hi @Divyateja2709,

Thank you for your PR and for the time and effort you put into contributing to CBOMkit—we truly appreciate your interest.

You may have noticed that we are already working on adding C/C++ support to sonar-cryptography in PR #377. This approach differs from yours, as it relies on Sonar’s native C/C++ support package rather than ANTLR, similar to how the existing Java module is implemented.

Work on PR #377 is already quite advanced, and at this stage we are leaning toward this approach because we expect it to provide stronger support for cross-file symbol tracing through the Sonar infrastructure.

That said, we will keep your PR open for now until a final decision is made.

@Divyateja2709
Copy link
Copy Markdown
Author

Hi @san-zrl sir,

Thank you for the clarification and for keeping the PR open.

I actually made these PRs as part of my contributions for the Linux Foundation Mentorship program. I explored this ANTLR-based approach and worked on multiple related PRs around it.

Could you please confirm if the mentorship/project is still open for contributors or mentees to continue working on it?

Thank you once again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants