Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds StatementHolder interface and ability to model statements in structure declarations #468

Merged
merged 10 commits into from
Jul 13, 2021

Conversation

konradweiss
Copy link
Collaborator

@konradweiss konradweiss commented Jul 12, 2021

Some languages allow to write executable code on file, class or even namespace level,
e.g. javas static and initializer blocks or any code outside of functions in scripting
languages.

This commit extracts the statement management from the CompoundStatement into default
implementations of the CodeHolder interface and implements it in RecordDeclaration,
NamespaceDeclaration and TranslationUnitDeclaration.

Additionally the EOG-Pass is adapted to also build EOG-Paths over those code blocks.

Closes #464

…claration

Some languages allow to write executable code on file, class or even namespace level,
e.g. javas static and initializer blocks or any code outside of functions in scripting
languages.

This commit extracts the statement management from the CompoundStatement into default
implementations of the CodeHolder interface and implements it in RecordDeclaration,
NamespaceDeclaration and TranslationUnitDeclaration.

Additionally the EOG-Pass is adapted to also build EOG-Paths over those code blocks.
@konradweiss konradweiss requested a review from oxisto as a code owner July 12, 2021 21:26
cpg-library/build.gradle.kts Outdated Show resolved Hide resolved
}

@NonNull
default List<PropertyEdge<Statement>> getStatementsPropertyEdge() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What’s the point of this additional getter?

@oxisto oxisto mentioned this pull request Jul 13, 2021
8 tasks
@oxisto oxisto added this to the 4.0 milestone Jul 13, 2021
@oxisto oxisto marked this pull request as draft July 13, 2021 08:56
@oxisto oxisto changed the title Adds CodeHolder interface and abillity to modell code in structure de… Adds StatementHolder interface and ability to model statements in structure declarations Jul 13, 2021
@sonarcloud
Copy link

sonarcloud bot commented Jul 13, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

70.7% 70.7% Coverage
0.0% 0.0% Duplication

@konradweiss konradweiss marked this pull request as ready for review July 13, 2021 15:13
@konradweiss konradweiss merged commit d420449 into master Jul 13, 2021
@konradweiss konradweiss deleted the feature/codeInDeclaration branch July 13, 2021 16:07
@oxisto oxisto mentioned this pull request Aug 4, 2021
20 tasks
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.

Store Record bodies / TranslationUnit bodies in the graph
2 participants