-
Notifications
You must be signed in to change notification settings - Fork 64
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
Implementing AST properties using singleton edge lists #1646
Conversation
9d732fc
to
37cdb1d
Compare
9250c6d
to
676f48a
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.
We should probably also re-generate the schema for the documentation when finishing this PR since some names of edges might have changed
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/ExpressionBuilder.kt
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/edges/EdgeWalker.kt
Outdated
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/edges/EdgeWalker.kt
Outdated
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/edges/Extensions.kt
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/edges/collections/EdgeSingletonList.kt
Outdated
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/IfStatement.kt
Outdated
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/IfStatement.kt
Outdated
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/IfStatement.kt
Outdated
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/expressions/CastExpression.kt
Outdated
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/helpers/SubgraphWalker.kt
Outdated
Show resolved
Hide resolved
72b2df4
to
7bf397e
Compare
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/ForEachStatement.kt
Show resolved
Hide resolved
4d94f90
to
31e0b65
Compare
I want to do another small clean up pass before merging. |
Quality Gate passedIssues Measures |
* Implementing AST properties using singleton edge lists This PR is a tryout * Adding mission relationship annotation * remove one more addStatement * Some additional cleanup * Slightly better naeming for delegate
This PR implements AST edges for all AST properties. Because of a bug (or rather "known limitation") of Neo4J OGM we need to be a bit tricky in assigning AST edges to single-node properties. Specifically, we need to wrap them into a singleton list of one element.
The major advantage is two-fold:
astParent
in the constructor of theAstEdge
(and probably do other things as well)There is a new
allEdges
/edges
function as well as a new shortcutastEdges
to retrieve all AST edges starting from a certain node.