-
Notifications
You must be signed in to change notification settings - Fork 62
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
Added more basic interfaces #1607
Conversation
11f2557
to
8784924
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how this solves the problem of casts between different interfaces. Shouldn't the "specific" interfaces extend the "basic" ones (e.g. HasBase: HasLanguage, HasNameAndLocation
) to accomplish this?
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/Interfaces.kt
Outdated
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/expressions/CallExpression.kt
Outdated
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/ControlDependenceGraphPass.kt
Outdated
Show resolved
Hide resolved
d13307c
to
3df6035
Compare
This PR adds more basic interfaces
Quality Gate passedIssues Measures |
This PR adds more basic interfaces. It solves the issue that we currently either have a direct node in our utility functions (for example symbol resolving), e.g. a
CallExpression
or some very specific interfacesHasBase
. But as we for example need aname
for theHasBase
interface/node, we need to do a very uglyas Node
cast.Therefore, in this PR we are adding some more basic interfaces that "describe" nodes, e.g., whether they have a name, location (actually all of the nodes have that) and a mixture of that.
This is prep work for #1606, for example where we need to share a common interface between calls and operator expressions which are overloadable. Something which is currently not yet possible with the current interfaces.